Skip to content

Commit

Permalink
Fix not stopped container in test (testcontainers#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Prokopchik authored and Konstantin Prokopchik committed Jul 19, 2017
1 parent f9378fa commit e1e770e
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,11 @@ public static void setupContent() throws FileNotFoundException {

@Test
public void testIsRunning() {
GenericContainer container = new GenericContainer();
assertFalse("Container is not started and not running", container.isRunning());
container.start();
assertTrue("Container is started and running", container.isRunning());
try (GenericContainer container = new GenericContainer()) {
assertFalse("Container is not started and not running", container.isRunning());
container.start();
assertTrue("Container is started and running", container.isRunning());
}
}

@Test
Expand Down

0 comments on commit e1e770e

Please sign in to comment.