List of usage examples for org.springframework.core NestedCheckedException getRootCause
@Nullable
public Throwable getRootCause()
From source file:sample.data.elasticsearch.SampleElasticsearchApplicationTests.java
private boolean serverNotRunning(IllegalStateException ex) { @SuppressWarnings("serial") NestedCheckedException nested = new NestedCheckedException("failed", ex) { };/*from www .j a va2 s. c o m*/ if (nested.contains(ConnectException.class)) { Throwable root = nested.getRootCause(); if (root.getMessage().contains("Connection refused")) { return true; } } return false; }