Skip to content

Commit

Permalink
fix: existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasBousselin committed Jan 20, 2025
1 parent c491bc8 commit 487d0a9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.egm.stellio.search.authorization.web
import com.egm.stellio.search.authorization.service.AuthorizationService
import com.egm.stellio.search.common.config.SearchProperties
import com.egm.stellio.search.csr.service.DistributedEntityConsumptionService
import com.egm.stellio.search.csr.service.DistributedEntityProvisionService
import com.egm.stellio.search.entity.service.EntityEventService
import com.egm.stellio.search.entity.service.EntityQueryService
import com.egm.stellio.search.entity.service.EntityService
Expand Down Expand Up @@ -44,6 +45,9 @@ class AnonymousUserHandlerTests {
@MockkBean
private lateinit var distributedEntityConsumptionService: DistributedEntityConsumptionService

@MockkBean
private lateinit var distributedEntityProvisionService: DistributedEntityProvisionService

@MockkBean(relaxed = true)
private lateinit var linkedEntityService: LinkedEntityService

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import com.egm.stellio.search.csr.CsrUtils.gimmeRawCSR
import com.egm.stellio.search.csr.model.MiscellaneousWarning
import com.egm.stellio.search.csr.model.NGSILDWarning
import com.egm.stellio.search.csr.service.DistributedEntityConsumptionService
import com.egm.stellio.search.csr.service.DistributedEntityProvisionService
import com.egm.stellio.search.csr.service.DistributionStatus
import com.egm.stellio.search.entity.model.EntitiesQueryFromGet
import com.egm.stellio.search.entity.model.NotUpdatedDetails
import com.egm.stellio.search.entity.model.UpdateResult
Expand Down Expand Up @@ -110,6 +112,9 @@ class EntityHandlerTests {
@MockkBean
private lateinit var distributedEntityConsumptionService: DistributedEntityConsumptionService

@MockkBean
private lateinit var distributedEntityProvisionService: DistributedEntityProvisionService

@MockkBean(relaxed = true)
private lateinit var linkedEntityService: LinkedEntityService

Expand All @@ -126,7 +131,7 @@ class EntityHandlerTests {
}

@BeforeEach
fun mockCSR() {
fun mockNoCSR() {
coEvery {
distributedEntityConsumptionService
.distributeRetrieveEntityOperation(any(), any(), any())
Expand All @@ -135,6 +140,11 @@ class EntityHandlerTests {
distributedEntityConsumptionService
.distributeQueryEntitiesOperation(any(), any(), any())
} returns Triple(emptyList(), emptyList(), emptyList())
val capturedExpandedEntity = slot<ExpandedEntity>()
coEvery {
distributedEntityProvisionService
.distributeCreateEntity(any(), capture(capturedExpandedEntity), any())
} answers { emptyList<DistributionStatus>() to capturedExpandedEntity.captured }
}

private val beehiveId = "urn:ngsi-ld:BeeHive:TESTC".toUri()
Expand Down

0 comments on commit 487d0a9

Please sign in to comment.