private void assertValidAnnotations(Class<?> testClass) { boolean hasWebAppConfiguration = AnnotationUtils.findAnnotation(testClass, WebAppConfiguration.class) != null; boolean hasWebIntegrationTest = AnnotationUtils.findAnnotation(testClass, WebIntegrationTest.class) != null; if (hasWebAppConfiguration && hasWebIntegrationTest) { throw new IllegalStateException("@WebIntegrationTest and " + "@WebAppConfiguration cannot be used together"); } }