[TEST] only call TestCluster#afterTest() if cluster was successfully initialized

This commit is contained in:
Simon Willnauer 2014-07-03 14:35:34 +02:00
parent 0475a052b0
commit f22e51ae81
1 changed files with 5 additions and 2 deletions

View File

@ -554,10 +554,13 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase
initializeGlobalCluster(); // re-init that cluster
}
}
if (currentCluster != null) {
// this can be null if the test fails due to static initialization ie. missing parameter on the cmd
currentCluster.afterTest();
currentCluster = null;
}
}
}
public static TestCluster cluster() {
return currentCluster;