Issue-ID: CPS-124
Change-Id: I6e423792c1a63d0f828577ca01d32366d2e693bb
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
public static DatabaseTestContainer getInstance() {
if (databaseTestContainer == null) {
databaseTestContainer = new DatabaseTestContainer();
+ Runtime.getRuntime().addShutdownHook(new Thread(databaseTestContainer::terminate));
}
return databaseTestContainer;
}
@Override
public void stop() {
- //do nothing, JVM handles shut down
+ // do nothing on test completion, image removal will be performed via terminate() on JVM shutdown
}
+ private void terminate() {
+ super.stop();
+ }
}