Prevent container to be closed twice

See gh-35120
This commit is contained in:
Yanming Zhou 2023-04-24 10:10:28 +08:00 committed by Stephane Nicoll
parent fd6214e7e3
commit 5df6913f18

View File

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