Skip to content

Commit

Permalink
fix(text): better time comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
bobeal committed Dec 23, 2024
1 parent e55f767 commit d522201
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.egm.stellio.search.entity.service

import arrow.core.right
import com.egm.stellio.search.authorization.service.AuthorizationService
import com.egm.stellio.search.entity.model.Attribute
import com.egm.stellio.search.entity.model.EntitiesQueryFromGet
import com.egm.stellio.search.entity.model.EntitiesQueryFromPost
import com.egm.stellio.search.entity.model.Entity
Expand Down Expand Up @@ -42,6 +43,7 @@ import org.junit.jupiter.params.provider.CsvSource
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.data.r2dbc.core.R2dbcEntityTemplate
import org.springframework.data.r2dbc.core.delete
import org.springframework.data.relational.core.query.Criteria
import org.springframework.data.relational.core.query.Query
import org.springframework.data.relational.core.query.Update
Expand Down Expand Up @@ -95,15 +97,8 @@ class EntityServiceQueriesTests : WithTimescaleContainer, WithKafkaContainer {

@AfterAll
fun deleteEntities() {
coEvery { authorizationService.userCanAdminEntity(any(), any()) } returns Unit.right()
coEvery { authorizationService.removeRightsOnEntity(any()) } returns Unit.right()
runBlocking {
entityService.deleteEntity(entity01Uri)
entityService.deleteEntity(entity02Uri)
entityService.deleteEntity(entity03Uri)
entityService.deleteEntity(entity04Uri)
entityService.deleteEntity(entity05Uri)
}
r2dbcEntityTemplate.delete<Entity>().from("entity_payload").all().block()
r2dbcEntityTemplate.delete<Attribute>().from("temporal_entity_attribute").all().block()
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ class AttributeInstanceServiceTests : WithTimescaleContainer, WithKafkaContainer
verify {
attributeInstanceService["create"](
match<AttributeInstance> {
it.time.toString() == "$deletedAt" &&
it.time == deletedAt &&
it.value == "urn:ngsi-ld:null" &&
it.measuredValue == null &&
it.payload.asString().matchContent(
Expand Down

0 comments on commit d522201

Please sign in to comment.