Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoloboschi committed Aug 22, 2024
1 parent 3a765a6 commit 93eedb2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ private void setupAssets(
try {
for (AssetNode assetNode : executionPlan.getAssets()) {
AssetDefinition asset =
ObjectMapperFactory.getDefaultMapper().convertValue(assetNode.config(), AssetDefinition.class);
ObjectMapperFactory.getDefaultMapper()
.convertValue(assetNode.config(), AssetDefinition.class);
try {
boolean created = setupAsset(asset, assetManagerRegistry);
if (created) {
Expand Down Expand Up @@ -238,7 +239,9 @@ private static SimpleRecord createAssetEventRecord(
.category(EventRecord.Categories.Asset)
.type(eventType)
.timestamp(System.currentTimeMillis())
.source(ObjectMapperFactory.getDefaultMapper().convertValue(source, Map.class))
.source(
ObjectMapperFactory.getDefaultMapper()
.convertValue(source, Map.class))
.data(data)
.build();

Expand Down Expand Up @@ -406,7 +409,8 @@ private void cleanupAssets(
try {
for (AssetNode assetNode : executionPlan.getAssets()) {
AssetDefinition asset =
ObjectMapperFactory.getDefaultMapper().convertValue(assetNode.config(), AssetDefinition.class);
ObjectMapperFactory.getDefaultMapper()
.convertValue(assetNode.config(), AssetDefinition.class);
try {
boolean deleted = cleanupAsset(asset);
if (deleted) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ public void accept(Object o) {
assertEquals(
"{\"tenant\":\"tenant\",\"applicationId\":\"app\",\"asset\":{\"id\":\"my-table\",\"name\":\"my-table\",\"config\":{\"datasource\":{\"configuration\":{\"service\":\"jdbc\",\"driverClass\":\"org.postgresql.Driver\",\"url\":\"bar\"}},\"table\":\"my-table\"},\"creation-mode\":\"create-if-not-exists\",\"deletion-mode\":\"delete\",\"asset-type\":\"mock-database-resource\",\"events-topic\":\"%s\"}}"
.formatted(eventsTopic),
ObjectMapperFactory.getDefaultMapper().writeValueAsString(read.get("source")));
ObjectMapperFactory.getDefaultMapper()
.writeValueAsString(read.get("source")));
assertNotNull(read.get("timestamp"));
}
}));
Expand Down Expand Up @@ -233,13 +234,16 @@ public void testDeployAssetFailed() throws Exception {
@SneakyThrows
public void accept(Object o) {
log.info("Received: {}", o);
Map read = ObjectMapperFactory.getDefaultMapper().readValue((String) o, Map.class);
Map read =
ObjectMapperFactory.getDefaultMapper()
.readValue((String) o, Map.class);
assertEquals("AssetCreationFailed", read.get("type"));
assertEquals("Asset", read.get("category"));
assertEquals(
"{\"tenant\":\"tenant\",\"applicationId\":\"app\",\"asset\":{\"id\":\"my-table\",\"name\":\"my-table\",\"config\":{\"fail\":true,\"datasource\":{\"configuration\":{\"service\":\"jdbc\",\"driverClass\":\"org.postgresql.Driver\",\"url\":\"bar\"}}},\"creation-mode\":\"create-if-not-exists\",\"deletion-mode\":\"delete\",\"asset-type\":\"mock-database-resource\",\"events-topic\":\"%s\"}}"
.formatted(eventsTopic),
ObjectMapperFactory.getDefaultMapper().writeValueAsString(read.get("source")));
ObjectMapperFactory.getDefaultMapper()
.writeValueAsString(read.get("source")));
assertEquals(
"Mock failure to deploy asset",
((Map<String, Object>) read.get("data"))
Expand Down

0 comments on commit 93eedb2

Please sign in to comment.