Skip to content

Commit

Permalink
fix: more conflicts with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ranim-n committed Jan 8, 2025
1 parent 8f035d0 commit 89a5d61
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
5 changes: 2 additions & 3 deletions search-service/config/detekt/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
<ID>LongMethod:EnabledAuthorizationServiceTests.kt$EnabledAuthorizationServiceTests$@Test fun `it should return serialized access control entities with other rigths if user is owner`()</ID>
<ID>LongMethod:EntityAccessControlHandler.kt$EntityAccessControlHandler$@PostMapping("/{subjectId}/attrs", consumes = [MediaType.APPLICATION_JSON_VALUE, JSON_LD_CONTENT_TYPE]) suspend fun addRightsOnEntities( @RequestHeader httpHeaders: HttpHeaders, @PathVariable subjectId: String, @RequestBody requestBody: Mono&lt;String&gt;, @AllowedParameters @RequestParam queryParams: MultiValueMap&lt;String, String&gt; ): ResponseEntity&lt;*&gt;</ID>
<ID>LongMethod:EntityEventService.kt$EntityEventService$private fun publishAttributeChangeEvent( sub: String?, tenantName: String, entityId: URI, entityTypesAndPayload: Pair&lt;List&lt;ExpandedTerm&gt;, String&gt;, attributeOperationResult: SucceededAttributeOperationResult )</ID>
<ID>LongMethod:EntityHandler.kt$EntityHandler$@GetMapping("/{entityId}", produces = [APPLICATION_JSON_VALUE, JSON_LD_CONTENT_TYPE, GEO_JSON_CONTENT_TYPE]) suspend fun getByURI( @RequestHeader httpHeaders: HttpHeaders, @PathVariable entityId: URI, @AllowedParameters( implemented = [ QP.OPTIONS, QP.TYPE, QP.ATTRS, QP.GEOMETRY_PROPERTY, QP.LANG, QP.CONTAINED_BY, QP.JOIN, QP.JOIN_LEVEL, QP.DATASET_ID, ], notImplemented = [QP.FORMAT, QP.PICK, QP.OMIT, QP.ENTITY_MAP, QP.LOCAL, QP.VIA] ) @RequestParam queryParams: MultiValueMap&lt;String, String&gt; ): ResponseEntity&lt;*&gt;</ID>
<ID>LongMethod:EntityHandler.kt$EntityHandler$@GetMapping(produces = [APPLICATION_JSON_VALUE, JSON_LD_CONTENT_TYPE, GEO_JSON_CONTENT_TYPE]) suspend fun getEntities( @RequestHeader httpHeaders: HttpHeaders, @AllowedParameters( implemented = [ QP.OPTIONS, QP.COUNT, QP.OFFSET, QP.LIMIT, QP.ID, QP.TYPE, QP.ID_PATTERN, QP.ATTRS, QP.Q, QP.GEOMETRY, QP.GEOREL, QP.COORDINATES, QP.GEOPROPERTY, QP.GEOMETRY_PROPERTY, QP.LANG, QP.SCOPEQ, QP.CONTAINED_BY, QP.JOIN, QP.JOIN_LEVEL, QP.DATASET_ID, ], notImplemented = [QP.FORMAT, QP.PICK, QP.OMIT, QP.EXPAND_VALUES, QP.CSF, QP.ENTITY_MAP, QP.LOCAL, QP.VIA] ) @RequestParam queryParams: MultiValueMap&lt;String, String&gt; ): ResponseEntity&lt;*&gt;</ID>
<ID>LongMethod:EntityHandler.kt$EntityHandler$@GetMapping("/{entityId}", produces = [APPLICATION_JSON_VALUE, JSON_LD_CONTENT_TYPE, GEO_JSON_CONTENT_TYPE]) suspend fun getByURI( @RequestHeader httpHeaders: HttpHeaders, @PathVariable entityId: URI, @AllowedParameters( implemented = [ QP.OPTIONS, QP.FORMAT, QP.TYPE, QP.ATTRS, QP.GEOMETRY_PROPERTY, QP.LANG, QP.CONTAINED_BY, QP.JOIN, QP.JOIN_LEVEL, QP.DATASET_ID, ], notImplemented = [QP.PICK, QP.OMIT, QP.ENTITY_MAP, QP.LOCAL, QP.VIA] ) @RequestParam queryParams: MultiValueMap&lt;String, String&gt; ): ResponseEntity&lt;*&gt;</ID>
<ID>LongMethod:EntityHandler.kt$EntityHandler$@GetMapping(produces = [APPLICATION_JSON_VALUE, JSON_LD_CONTENT_TYPE, GEO_JSON_CONTENT_TYPE]) suspend fun getEntities( @RequestHeader httpHeaders: HttpHeaders, @AllowedParameters( implemented = [ QP.OPTIONS, QP.FORMAT, QP.COUNT, QP.OFFSET, QP.LIMIT, QP.ID, QP.TYPE, QP.ID_PATTERN, QP.ATTRS, QP.Q, QP.GEOMETRY, QP.GEOREL, QP.COORDINATES, QP.GEOPROPERTY, QP.GEOMETRY_PROPERTY, QP.LANG, QP.SCOPEQ, QP.CONTAINED_BY, QP.JOIN, QP.JOIN_LEVEL, QP.DATASET_ID, ], notImplemented = [QP.PICK, QP.OMIT, QP.EXPAND_VALUES, QP.CSF, QP.ENTITY_MAP, QP.LOCAL, QP.VIA] ) @RequestParam queryParams: MultiValueMap&lt;String, String&gt; ): ResponseEntity&lt;*&gt;</ID>
<ID>LongMethod:LinkedEntityServiceTests.kt$LinkedEntityServiceTests$@Test fun `it should inline entities up to the asked 2nd level`()</ID>
<ID>LongMethod:PatchAttributeTests.kt$PatchAttributeTests.Companion$@JvmStatic fun mergePatchProvider(): Stream&lt;Arguments&gt;</ID>
<ID>LongMethod:PatchAttributeTests.kt$PatchAttributeTests.Companion$@JvmStatic fun partialUpdatePatchProvider(): Stream&lt;Arguments&gt;</ID>
<ID>LongMethod:TemporalQueryServiceTests.kt$TemporalQueryServiceTests$@Test fun `it should query temporal entities as requested by query params`()</ID>
<ID>LongMethod:TemporalQueryServiceTests.kt$TemporalQueryServiceTests$@Test fun `it should return an empty list for an attribute if it has no temporal values`()</ID>
<ID>LongMethod:TemporalScopeBuilderTests.kt$TemporalScopeBuilderTests$@Test fun `it should build an aggregated temporal representation of scopes`()</ID>
<ID>LongMethod:V0_29__JsonLd_migration.kt$V0_29__JsonLd_migration$override fun migrate(context: Context)</ID>
<ID>LongParameterList:AttributeInstance.kt$AttributeInstance.Companion$( attributeUuid: UUID, instanceId: URI = generateRandomInstanceId(), timeAndProperty: Pair&lt;ZonedDateTime, TemporalProperty&gt;, value: Triple&lt;String?, Double?, WKTCoordinates?&gt;, payload: ExpandedAttributeInstance, sub: String? )</ID>
<ID>LongParameterList:AttributeInstance.kt$AttributeInstance.Companion$( attributeUuid: UUID, instanceId: URI = generateRandomInstanceId(), timeProperty: TemporalProperty? = TemporalProperty.OBSERVED_AT, modifiedAt: ZonedDateTime? = null, attributeMetadata: AttributeMetadata, payload: ExpandedAttributeInstance, time: ZonedDateTime, sub: String? = null )</ID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class TemporalQueryService(
// - timeAt if it is provided
// - the oldest value if not (timeAt is optional if querying a temporal entity by id)

if (!(temporalEntitiesQuery.temporalRepresentation == TemporalRepresentation.AGGREGATED_VALUES))
return null
return if (temporalEntitiesQuery.temporalRepresentation != TemporalRepresentation.AGGREGATED_VALUES)
null
else if (temporalQuery.timeAt != null)
temporalQuery.timeAt
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = now.minusHours(1)
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(temporalEntitiesQuery, incomingAttribute)
.shouldSucceedWith {
Expand All @@ -227,7 +227,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timeAt = now.minusHours(1),
timeproperty = AttributeInstance.TemporalProperty.CREATED_AT
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(temporalEntitiesQuery, incomingAttribute)
.shouldSucceedWith {
Expand All @@ -253,7 +253,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timeAt = now.minusHours(1),
timeproperty = AttributeInstance.TemporalProperty.CREATED_AT
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(temporalEntitiesQuery, incomingAttribute)
.shouldSucceedWith {
Expand All @@ -279,7 +279,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timeAt = now.minusHours(1),
timeproperty = AttributeInstance.TemporalProperty.MODIFIED_AT
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(temporalEntitiesQuery, incomingAttribute)
.shouldSucceedWith {
Expand All @@ -299,7 +299,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = now.minusHours(1)
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(temporalEntitiesQuery, incomingAttribute)
.shouldSucceedWith {
Expand All @@ -315,7 +315,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
}

attributeInstanceService.search(
gimmeTemporalEntitiesQuery(buildDefaultTestTemporalQuery(), TemporalRepresentation.NONE),
gimmeTemporalEntitiesQuery(buildDefaultTestTemporalQuery(), TemporalRepresentation.NORMALIZED),
incomingAttribute
)
.shouldSucceedWith {
Expand Down Expand Up @@ -416,7 +416,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timeAt = ZonedDateTime.parse("2022-07-01T00:00:00Z"),
instanceLimit = 5
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)

attributeInstanceService.search(temporalEntitiesQuery, incomingAttribute)
Expand All @@ -443,7 +443,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
endTimeAt = ZonedDateTime.parse("2022-07-05T00:00:00Z"),
instanceLimit = 5
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)

attributeInstanceService.search(temporalEntitiesQuery, incomingAttribute)
Expand Down Expand Up @@ -471,7 +471,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
instanceLimit = 5,
lastN = 5
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(temporalEntitiesQuery, incomingAttribute)
.shouldSucceedWith {
Expand Down Expand Up @@ -534,7 +534,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = now.minusHours(1)
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(temporalEntitiesQuery, incomingAttribute)
.shouldSucceedWith { results ->
Expand All @@ -557,7 +557,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = now.minusHours(1)
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(
temporalEntitiesQuery,
Expand All @@ -579,7 +579,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = now.plusHours(1)
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(temporalEntitiesQuery, incomingAttribute)
.shouldSucceedWith {
Expand Down Expand Up @@ -821,7 +821,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = ZonedDateTime.parse("1970-01-01T00:00:00Z")
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)

attributeInstanceService.modifyAttributeInstance(
Expand Down Expand Up @@ -860,7 +860,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = ZonedDateTime.parse("1970-01-01T00:00:00Z")
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)

attributeInstanceService.modifyAttributeInstance(
Expand Down Expand Up @@ -900,7 +900,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = ZonedDateTime.parse("1970-01-01T00:00:00Z")
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)

attributeInstanceService.modifyAttributeInstance(
Expand Down Expand Up @@ -945,7 +945,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = ZonedDateTime.parse("1970-01-01T00:00:00Z")
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)

attributeInstanceService.modifyAttributeInstance(
Expand Down Expand Up @@ -984,7 +984,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
).shouldSucceed()

attributeInstanceService.search(
gimmeTemporalEntitiesQuery(buildDefaultTestTemporalQuery(), TemporalRepresentation.NONE),
gimmeTemporalEntitiesQuery(buildDefaultTestTemporalQuery(), TemporalRepresentation.NORMALIZED),
incomingAttribute
)
.shouldSucceedWith {
Expand Down Expand Up @@ -1059,7 +1059,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = now.minusHours(1)
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(temporalEntitiesQuery, incomingAttribute)
.shouldSucceedWith { assertThat(it).isEmpty() }
Expand All @@ -1070,7 +1070,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timeAt = now.minusHours(1),
timeproperty = AttributeInstance.TemporalProperty.CREATED_AT
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)

attributeInstanceService.search(temporalEntitiesAuditQuery, incomingAttribute)
Expand All @@ -1097,7 +1097,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = now.minusHours(1)
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(temporalEntitiesQuery, outgoingAttribute)
.shouldSucceedWith { assertThat(it).hasSize(5) }
Expand Down Expand Up @@ -1125,7 +1125,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
timerel = Timerel.AFTER,
timeAt = now.minusHours(1)
),
TemporalRepresentation.NONE
TemporalRepresentation.NORMALIZED
)
attributeInstanceService.search(temporalEntitiesQuery, outgoingAttribute)
.shouldSucceedWith { assertThat(it).hasSize(5) }
Expand Down

0 comments on commit 89a5d61

Please sign in to comment.