Consider the following test:
@Test(timeout = 5_000)
public void testExitingContainer() {
try (
GenericContainer container = new GenericContainer<>()
.withCreateContainerCmdModifier(it -> it.getHostConfig().withAutoRemove(true))
.withStartupCheckStrategy(new OneShotStartupCheckStrategy())
) {
container.start();
}
}
It will fail because the container exits immediately and OneShotStartupCheckStrategy receives NotFoundException.
The question is - what should we do? StartupStatus.SUCCESSFUL or StartupStatus.FAILED?