Class FlociContainer
java.lang.Object
io.ebean.test.containers.FlociContainer
- All Implemented Interfaces:
Container<FlociContainer>
Floci container that supports AWS SDK v2.
FlociContainer container = FlociContainer.builder("latest")
// .port(4566)
// .image("hectorvent/floci:latest")
.build();
container.start();
AwsSDKv2 sdk = container.sdk2();
var amazonDynamoDB = sdk.dynamoDBClient();
createTable(amazonDynamoDB);
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFlociContainer(FlociContainer.Builder builder) Create the container using the given config. -
Method Summary
Modifier and TypeMethodDescriptionReturn the AWS region.static FlociContainer.BuilderCreate a builder for FlociContainer given the Floci image version.config()Returns the container configuration.protected ProcessBuildercreateProcessBuilder(List<String> args) endpoint()Return the endpoint as URI.Return the endpoint as String.booleanReturn true if the container is running.intport()Return the port this container is using.protected StringreadUrlContent(String url) Return http GET content given the url.voidRegister a JVM Shutdown hook to stop the container with the given mode.protected ProcessBuilderReturn the ProcessBuilder used to execute the container run command.sdk()Return the AWS v2 SDK compatible helper that provides API for DynamoDB client, SnsClient, SqsClient etc.sdk2()Return the AWS v2 SDK compatible helper that provides API for DynamoDB client, SnsClient, SqsClient etc.protected voidSet a default container name if not using random port.protected booleanshutdownHook(boolean started) start()Start and return the container.booleanStart the container returning true if successful.voidStart the container or throw a IllegalStateException.protected booleanvoidstop()Stop using the configured stopMode of 'stop' or 'remove'.voidStop and remove the container effectively deleting the container.
-
Field Details
-
buildConfig
protected final io.ebean.test.containers.BaseBuilder<?,?> buildConfig -
config
protected io.ebean.test.containers.InternalConfig config -
commands
-
waitForConnectivityAttempts
protected int waitForConnectivityAttempts -
shutdownMode
-
usingContainerId
protected boolean usingContainerId -
usingRandomPort
protected boolean usingRandomPort -
removeOnExit
protected boolean removeOnExit
-
-
Constructor Details
-
FlociContainer
Create the container using the given config.
-
-
Method Details
-
start
Description copied from interface:ContainerStart and return the container.Throws an IllegalStateException if the container can not be started.
-
builder
Create a builder for FlociContainer given the Floci image version. -
sdk
Return the AWS v2 SDK compatible helper that provides API for DynamoDB client, SnsClient, SqsClient etc. -
sdk2
Return the AWS v2 SDK compatible helper that provides API for DynamoDB client, SnsClient, SqsClient etc. -
endpoint
Return the endpoint as URI. -
endpointUrl
Return the endpoint as String. -
awsRegion
Return the AWS region. -
runProcess
Return the ProcessBuilder used to execute the container run command. -
config
Description copied from interface:ContainerReturns the container configuration. -
startMaybe
public boolean startMaybe()Description copied from interface:ContainerStart the container returning true if successful.- Specified by:
startMaybein interfaceContainer<C extends Container<C>>
-
startOrThrow
public void startOrThrow()Description copied from interface:ContainerStart the container or throw a IllegalStateException.- Specified by:
startOrThrowin interfaceContainer<C extends Container<C>>
-
port
-
setDefaultContainerName
protected void setDefaultContainerName()Set a default container name if not using random port. -
isRunning
-
registerShutdownHook
public void registerShutdownHook()Register a JVM Shutdown hook to stop the container with the given mode. -
shutdownHook
protected boolean shutdownHook(boolean started) -
startWithConnectivity
protected boolean startWithConnectivity() -
stop
-
stopRemove
public void stopRemove()Stop and remove the container effectively deleting the container.- Specified by:
stopRemovein interfaceContainer<C extends Container<C>>
-
createProcessBuilder
-
dockerRun
-
readUrlContent
Return http GET content given the url.- Throws:
IOException
-