private Statement failOrSkip(final Exception e) {
		String serversRequired = System.getenv(XD_EXTERNAL_SERVERS_REQUIRED);
		if ("true".equalsIgnoreCase(serversRequired)) {
			logger.error(resourceDescription + " IS REQUIRED BUT NOT AVAILABLE", e);
			fail(resourceDescription + " IS NOT AVAILABLE");
			// Never reached, here to satisfy method signature
			return null;
		}
		else {
			logger.error(resourceDescription + " IS NOT AVAILABLE, SKIPPING TESTS", e);
			return new Statement() {

				@Override
				public void evaluate() throws Throwable {
					Assume.assumeTrue("Skipping test due to " + resourceDescription + " not being available " + e, false);
				}
			};
		}
	}
Abstract base class for JUnit {@link Rule}s that detect the presence of some external resource. If the resource is
indeed present, it will be available during the test lifecycle through {@link #getResource()}. If it is not, tests
will either fail or be skipped, depending on the value of system property {@value #XD_EXTERNAL_SERVERS_REQUIRED}.

@author Eric Bottard
@author Gary Russell
spring-xd-test/src/main/java/org/springframework/xd/test/AbstractExternalResourceTestSupport.java