From df46ed875434c3c4045f92cdee7430c3115c2b2b Mon Sep 17 00:00:00 2001 From: Dan Newton Date: Fri, 13 Oct 2023 14:13:19 +0100 Subject: [PATCH] CORE-15552 Compilation --- ...atesByExactTypeExternalEventFactoryTest.kt | 62 ------------------- 1 file changed, 62 deletions(-) delete mode 100644 components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/persistence/external/events/FindUnconsumedStatesByExactTypeExternalEventFactoryTest.kt diff --git a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/persistence/external/events/FindUnconsumedStatesByExactTypeExternalEventFactoryTest.kt b/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/persistence/external/events/FindUnconsumedStatesByExactTypeExternalEventFactoryTest.kt deleted file mode 100644 index cbc8bf10d85b..000000000000 --- a/components/ledger/ledger-utxo-flow/src/test/kotlin/net/corda/ledger/utxo/flow/impl/persistence/external/events/FindUnconsumedStatesByExactTypeExternalEventFactoryTest.kt +++ /dev/null @@ -1,62 +0,0 @@ -package net.corda.ledger.utxo.flow.impl.persistence.external.events - -import net.corda.data.KeyValuePairList -import net.corda.data.flow.event.external.ExternalEventContext -import net.corda.data.ledger.persistence.FindUnconsumedStatesByExactType -import net.corda.data.ledger.persistence.LedgerPersistenceRequest -import net.corda.data.ledger.persistence.LedgerTypes -import net.corda.flow.state.FlowCheckpoint -import net.corda.schema.Schemas -import net.corda.v5.ledger.utxo.ContractState -import net.corda.virtualnode.toCorda -import org.junit.jupiter.api.Assertions.assertEquals -import org.junit.jupiter.api.Assertions.assertNull -import org.junit.jupiter.api.Test -import org.mockito.kotlin.mock -import org.mockito.kotlin.whenever -import java.security.PublicKey -import java.time.Clock -import java.time.Instant -import java.time.ZoneId - -class FindUnconsumedStatesByExactTypeExternalEventFactoryTest { - - class TestContractState : ContractState { - override fun getParticipants(): List { - return emptyList() - } - } - - @Test - fun `creates a record containing an UtxoLedgerRequest with a FindUnconsumedStatesByExactType payload`() { - val checkpoint = mock() - val stateClass = TestContractState()::class.java - val externalEventContext = ExternalEventContext( - "request id", - "flow id", - KeyValuePairList(emptyList()) - ) - val testClock = Clock.fixed(Instant.now(), ZoneId.of("UTC")) - - whenever(checkpoint.holdingIdentity).thenReturn(ALICE_X500_HOLDING_IDENTITY.toCorda()) - - val externalEventRecord = FindUnconsumedStatesByExactTypeExternalEventFactory(testClock).createExternalEvent( - checkpoint, - externalEventContext, - FindUnconsumedStatesByTypeParameters(stateClass) - ) - - assertEquals(Schemas.Persistence.PERSISTENCE_LEDGER_PROCESSOR_TOPIC, externalEventRecord.topic) - assertNull(externalEventRecord.key) - assertEquals( - LedgerPersistenceRequest( - testClock.instant(), - ALICE_X500_HOLDING_IDENTITY, - LedgerTypes.UTXO, - FindUnconsumedStatesByExactType(stateClass.canonicalName), - externalEventContext - ), - externalEventRecord.payload - ) - } -}