Prevent container to be closed twice

See gh-35120
pull/35166/head
Yanming Zhou 2 years ago committed by Stephane Nicoll
parent fd6214e7e3
commit 5df6913f18

@ -41,9 +41,7 @@ class TestcontainersLifecycleBeanPostProcessor implements DestructionAwareBeanPo
@Override @Override
public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException { public void postProcessBeforeDestruction(Object bean, String beanName) throws BeansException {
if (bean instanceof Startable startable) { // Startable extends AutoCloseable will always be closed by context
startable.stop();
}
} }
@Override @Override

Loading…
Cancel
Save