@@ -17,7 +17,7 @@ import kotlin.test.assertEquals
1717@ExperimentalCoroutinesApi
1818internal class EventStoreDBRepositoryTest : WithEventStoreDBContainer () {
1919 companion object {
20- private const val STREAM_NAME_PREFIX = " CounterAggregateRoot"
20+ private const val STREAM_NAME = " CounterAggregateRoot"
2121 }
2222
2323 private val testDispatcher = UnconfinedTestDispatcher ()
@@ -29,10 +29,8 @@ internal class EventStoreDBRepositoryTest : WithEventStoreDBContainer() {
2929
3030 @BeforeEach
3131 fun setUp () {
32- // Use a unique stream name for each test to prevent event pollution
33- val uniqueStreamName = " $STREAM_NAME_PREFIX -${UUID .randomUUID()} "
3432 val connectionString = " kurrentdb://127.0.0.1:${container.getMappedPort(2113 )} ?tls=false&tlsVerifyCert=false"
35- repositoryConfig = EventStoreDBRepositoryConfig (EventStoreDBConfig (connectionString), uniqueStreamName , 500 , 500 )
33+ repositoryConfig = EventStoreDBRepositoryConfig (EventStoreDBConfig (connectionString), STREAM_NAME , 500 , 500 )
3634 repository = EventStoreDBRepository (
3735 repositoryConfig,
3836 { CounterAggregateRoot (it as CounterAggregateId ) }
@@ -143,8 +141,7 @@ internal class EventStoreDBRepositoryTest : WithEventStoreDBContainer() {
143141 val streamName = repository.aggregateIdStreamName(aggregateId)
144142
145143 // Then
146- // Stream name should not contain the aggregate ID
147- assertEquals(repositoryConfig.streamName, streamName)
144+ assertEquals(" $STREAM_NAME .${aggregateId.valueAsString()} " , streamName)
148145 }
149146
150147 @Test
0 commit comments