-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into update-gradle-wrapper
- Loading branch information
Showing
8 changed files
with
107 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
src/main/kotlin/com/rogervinas/stream/shared/MyContainers.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/test/kotlin/com/rogervinas/stream/helper/DockerComposeContainerHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.rogervinas.stream.helper | ||
|
||
import org.testcontainers.containers.ComposeContainer | ||
import org.testcontainers.containers.wait.strategy.Wait.forListeningPort | ||
import org.testcontainers.containers.wait.strategy.Wait.forLogMessage | ||
import org.testcontainers.containers.wait.strategy.WaitAllStrategy | ||
import org.testcontainers.containers.wait.strategy.WaitAllStrategy.Mode.WITH_INDIVIDUAL_TIMEOUTS_ONLY | ||
import java.io.File | ||
|
||
class DockerComposeContainerHelper { | ||
|
||
companion object { | ||
private const val BROKER = "broker" | ||
private const val BROKER_PORT = 9094 | ||
private const val ZOOKEEPER = "zookeeper" | ||
private const val ZOOKEEPER_PORT = 2181 | ||
} | ||
|
||
fun createContainer(): ComposeContainer { | ||
return ComposeContainer(File("docker-compose.yml")) | ||
.withLocalCompose(true) | ||
.withExposedService( | ||
BROKER, | ||
BROKER_PORT, | ||
WaitAllStrategy(WITH_INDIVIDUAL_TIMEOUTS_ONLY) | ||
.withStrategy(forListeningPort()) | ||
.withStrategy(forLogMessage(".*started.*", 1)) | ||
) | ||
.withExposedService( | ||
ZOOKEEPER, | ||
ZOOKEEPER_PORT, | ||
WaitAllStrategy(WITH_INDIVIDUAL_TIMEOUTS_ONLY) | ||
.withStrategy(forListeningPort()) | ||
.withStrategy(forLogMessage(".*Started.*", 1)) | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters