Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ class DefaultTestDynamoDbClient(
override val tables: List<TestTable>,
private val port: Int,
) : AbstractIdleService(), TestDynamoDbClient {
// TODO: Is there a better way of doing this than making a network connection?
// Lazy so that hostName is resolved after the DynamoDB Local server is started,
// not at construction time when the placeholder ServerSocket is still holding the port.
private val hostName by lazy { hostName(port) }

override val dynamoDb = buildDynamoDb(hostName, port)
override val dynamoDbStreams = buildDynamoDbStreams(hostName, port)
override val dynamoDb by lazy { buildDynamoDb(hostName, port) }
override val dynamoDbStreams by lazy { buildDynamoDbStreams(hostName, port) }

override fun startUp() {
reset()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ class DefaultTestDynamoDbClient(
override val tables: List<TestTable>,
private val port: Int,
) : AbstractIdleService(), TestDynamoDbClient {
// TODO: Is there a better way of doing this than making a network connection?
// Lazy so that hostName is resolved after the DynamoDB Local server is started,
// not at construction time when the placeholder ServerSocket is still holding the port.
private val hostName by lazy { hostName(port) }

override val dynamoDb = buildDynamoDb(hostName, port)
override val asyncDynamoDb = buildAsyncDynamoDb(hostName, port)
override val dynamoDbStreams = buildDynamoDbStreams(hostName, port)
override val asyncDynamoDbStreams = buildAsyncDynamoDbStreams(hostName, port)
override val dynamoDb by lazy { buildDynamoDb(hostName, port) }
override val asyncDynamoDb by lazy { buildAsyncDynamoDb(hostName, port) }
override val dynamoDbStreams by lazy { buildDynamoDbStreams(hostName, port) }
override val asyncDynamoDbStreams by lazy { buildAsyncDynamoDbStreams(hostName, port) }

override fun startUp() {
reset()
Expand Down
Loading