Skip to content

Commit

Permalink
Fix docker cleanup step ordering of BsonDiffVisitorIT.
Browse files Browse the repository at this point in the history
Docker client was terminted before containers were.

Signed-off-by: Yufei Cai <yufei.cai@bosch.io>
  • Loading branch information
yufei-cai committed May 27, 2022
1 parent 66fb5f4 commit 2c82756
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Expand Up @@ -26,7 +26,7 @@
* the MongoDB container address instead of starting its own container.
*/
@NotThreadSafe
public final class MongoDbResource extends ExternalResource implements Closeable {
public final class MongoDbResource extends ExternalResource {

private static final int MONGO_INTERNAL_PORT = 27017;
private static final String MONGO_CONTAINER_ALREADY_STARTED = "Mongo container has already been started.";
Expand Down Expand Up @@ -62,11 +62,11 @@ protected void after() {
mongoContainer.remove();
mongoContainer = null;
}
}

@Override
public void close() throws IOException {
mongoContainerFactory.close();
try {
mongoContainerFactory.close();
} catch (final IOException e) {
throw new AssertionError(e);
}
}

/**
Expand Down
Expand Up @@ -62,11 +62,6 @@ public final class BsonDiffVisitorIT {
private Policy policy;
private Policy policy2;

@AfterClass
public static void closeMongoResource() throws IOException {
MONGO_RESOURCE.close();
}

@Before
public void init() {
client = MongoClientWrapper.getBuilder()
Expand Down

0 comments on commit 2c82756

Please sign in to comment.