diff --git a/README.md b/README.md index 21934a1ca9..3024e324f2 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ To format the code, we use Intellij built-in formatter with settings that can be Import settings with `File/Manage IDE Settings/Import Settings...`. -You can use plugins like `Save Actions` (https://plugins.jetbrains.com/plugin/7642-save-actions) that applies changed code refactoring and optimized imports on a save. +You can use plugins like [Save Actions](https://plugins.jetbrains.com/plugin/7642-save-actions) that applies changed code refactoring and optimized imports on a save. ### Working locally with Docker images diff --git a/entity-service/src/main/kotlin/com/egm/stellio/entity/service/EntityOperationService.kt b/entity-service/src/main/kotlin/com/egm/stellio/entity/service/EntityOperationService.kt index 27349cad89..97b97f1827 100644 --- a/entity-service/src/main/kotlin/com/egm/stellio/entity/service/EntityOperationService.kt +++ b/entity-service/src/main/kotlin/com/egm/stellio/entity/service/EntityOperationService.kt @@ -92,11 +92,14 @@ class EntityOperationService( }.collect( { BatchOperationResult() }, { batchOperationResult, updateResult -> - updateResult.fold({ - batchOperationResult.errors.add(it) - }, { - batchOperationResult.success.add(it) - }) + updateResult.fold( + { + batchOperationResult.errors.add(it) + }, + { + batchOperationResult.success.add(it) + } + ) }, BatchOperationResult::plusAssign ) diff --git a/entity-service/src/test/kotlin/com/egm/stellio/entity/web/EntityHandlerTests.kt b/entity-service/src/test/kotlin/com/egm/stellio/entity/web/EntityHandlerTests.kt index e609520649..1c7fc1feca 100644 --- a/entity-service/src/test/kotlin/com/egm/stellio/entity/web/EntityHandlerTests.kt +++ b/entity-service/src/test/kotlin/com/egm/stellio/entity/web/EntityHandlerTests.kt @@ -617,7 +617,7 @@ class EntityHandlerTests { .header("Link", "<$aquacContext>; rel=http://www.w3.org/ns/json-ld#context; type=application/ld+json") .bodyValue(jsonLdFile) .exchange() - .expectStatus().isEqualTo(HttpStatus.NO_CONTENT) + .expectStatus().isEqualTo(HttpStatus.MULTI_STATUS) verify { entityService.exists(eq("urn:ngsi-ld:DeadFishes:019BN")) } verify { entityService.updateEntityAttributes(eq(entityId), any(), eq(aquacContext!!)) } diff --git a/search-service/src/main/kotlin/com/egm/stellio/search/web/TemporalEntityHandler.kt b/search-service/src/main/kotlin/com/egm/stellio/search/web/TemporalEntityHandler.kt index 2d6718453c..65d48c5c1b 100644 --- a/search-service/src/main/kotlin/com/egm/stellio/search/web/TemporalEntityHandler.kt +++ b/search-service/src/main/kotlin/com/egm/stellio/search/web/TemporalEntityHandler.kt @@ -36,7 +36,6 @@ import org.springframework.web.bind.annotation.RestController import reactor.core.publisher.Flux import reactor.core.publisher.Mono import reactor.kotlin.core.publisher.toMono -import java.lang.IllegalArgumentException import java.util.Optional @RestController diff --git a/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityHandlerTests.kt b/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityHandlerTests.kt index 51060bcdde..ee4119e910 100644 --- a/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityHandlerTests.kt +++ b/search-service/src/test/kotlin/com/egm/stellio/search/web/TemporalEntityHandlerTests.kt @@ -85,7 +85,8 @@ class TemporalEntityHandlerTests { ) } verify { - attributeInstanceService.addAttributeInstances(eq(temporalEntityAttributeUuid), + attributeInstanceService.addAttributeInstances( + eq(temporalEntityAttributeUuid), eq("incoming"), match { it.size == 4 diff --git a/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/SubscriptionService.kt b/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/SubscriptionService.kt index dcba553481..09064fd607 100644 --- a/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/SubscriptionService.kt +++ b/subscription-service/src/main/kotlin/com/egm/stellio/subscription/service/SubscriptionService.kt @@ -182,15 +182,18 @@ class SubscriptionService( val value = it.value.toSqlValue(it.key) val updateStatement = Update.update(columnName, value) - updates.add(databaseClient.update() - .table("subscription") - .using(updateStatement) - .matching(Criteria.where("id").`is`(subscriptionId)) - .fetch() - .rowsUpdated() - .doOnError { e -> - throw BadRequestDataException(e.message ?: "Could not update attribute ${it.key}") - } + updates.add( + databaseClient.update() + .table("subscription") + .using(updateStatement) + .matching(Criteria.where("id").`is`(subscriptionId)) + .fetch() + .rowsUpdated() + .doOnError { e -> + throw BadRequestDataException( + e.message ?: "Could not update attribute ${it.key}" + ) + } ) } }