Ensure CLI adds @EnableAutoConfiguration in an appropriate place
Up to now we have been treating the *first* class to be compiled as the "main" application and adding @EnableAutoConfiguration. This isn't always appropriate (e.g. if it's a test case), so now we look for an appropriate annotation before falling back to the old behaviour. In addition ensures classes with a field of type Reactor trigger the reactor auto imports. See gh-969
This commit is contained in:
@@ -88,6 +88,18 @@ public class TestCommandIntegrationTests {
|
||||
assertThat(output, containsString("OK (1 test)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void integrationAutoConfigEmbeddedTest() throws Exception {
|
||||
String output = this.cli.test("integration_auto.groovy");
|
||||
assertThat(output, containsString("OK (1 test)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void integrationAutoConfigTest() throws Exception {
|
||||
String output = this.cli.test("integration_auto_test.groovy", "reactor.groovy");
|
||||
assertThat(output, containsString("OK (1 test)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void spockTester() throws Exception {
|
||||
String output = this.cli.test("spock.groovy");
|
||||
|
||||
@@ -53,7 +53,7 @@ public class ExtendedGroovyClassLoaderTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void filteresNonGroovy() throws Exception {
|
||||
public void filtersNonGroovy() throws Exception {
|
||||
this.contextClassLoader.loadClass("org.springframework.util.StringUtils");
|
||||
this.thrown.expect(ClassNotFoundException.class);
|
||||
this.defaultScopeGroovyClassLoader
|
||||
|
||||
Reference in New Issue
Block a user