From 6b3b0dd3a6ac4818388e97e121de69a91e21657d Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Fri, 2 Sep 2022 16:27:59 -0500 Subject: [PATCH] Generate ManagementContextConfiguration.imports file from annotations This commit adds the `ManagementContextConfigurationImportsAnnotationProcessor` to the `spring-boot-autoconfigure-processor` annotation processor module. Closes gh-32222 --- ...web.ManagementContextConfiguration.imports | 10 --- .../AbstractImportsAnnotationProcessor.java | 85 +++++++++++++++++++ ...nfigurationImportsAnnotationProcessor.java | 58 +------------ ...nfigurationImportsAnnotationProcessor.java | 37 ++++++++ .../gradle/incremental.annotation.processors | 3 +- .../javax.annotation.processing.Processor | 1 + ...rationImportsAnnotationProcessorTests.java | 12 +-- ...rationImportsAnnotationProcessorTests.java | 82 ++++++++++++++++++ .../TestManagementContextConfiguration.java | 36 ++++++++ ...nfigurationImportsAnnotationProcessor.java | 31 +++++++ ...TestManagementContextConfigurationOne.java | 27 ++++++ ...TestManagementContextConfigurationTwo.java | 27 ++++++ 12 files changed, 335 insertions(+), 74 deletions(-) delete mode 100644 spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/AbstractImportsAnnotationProcessor.java create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/ManagementContextConfigurationImportsAnnotationProcessor.java create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/ManagementContextConfigurationImportsAnnotationProcessorTests.java create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfiguration.java create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationImportsAnnotationProcessor.java create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationOne.java create mode 100644 spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationTwo.java diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports deleted file mode 100644 index 136ca59703..0000000000 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports +++ /dev/null @@ -1,10 +0,0 @@ -org.springframework.boot.actuate.autoconfigure.endpoint.web.ServletEndpointManagementContextConfiguration -org.springframework.boot.actuate.autoconfigure.endpoint.web.jersey.JerseyWebEndpointManagementContextConfiguration -org.springframework.boot.actuate.autoconfigure.endpoint.web.reactive.WebFluxEndpointManagementContextConfiguration -org.springframework.boot.actuate.autoconfigure.endpoint.web.servlet.WebMvcEndpointManagementContextConfiguration -org.springframework.boot.actuate.autoconfigure.security.servlet.SecurityRequestMatchersManagementContextConfiguration -org.springframework.boot.actuate.autoconfigure.web.jersey.JerseySameManagementContextConfiguration -org.springframework.boot.actuate.autoconfigure.web.jersey.JerseyChildManagementContextConfiguration -org.springframework.boot.actuate.autoconfigure.web.reactive.ReactiveManagementChildContextConfiguration -org.springframework.boot.actuate.autoconfigure.web.servlet.ServletManagementChildContextConfiguration -org.springframework.boot.actuate.autoconfigure.web.servlet.WebMvcEndpointChildContextConfiguration diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/AbstractImportsAnnotationProcessor.java b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/AbstractImportsAnnotationProcessor.java new file mode 100644 index 0000000000..ad5f40bed0 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/AbstractImportsAnnotationProcessor.java @@ -0,0 +1,85 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigureprocessor; + +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.Filer; +import javax.annotation.processing.RoundEnvironment; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.Element; +import javax.lang.model.element.TypeElement; +import javax.tools.FileObject; +import javax.tools.StandardLocation; + +/** + * An {@link AbstractProcessor} to scan for annotated classes and write the class names to + * a file using the Spring Boot {@code .imports} format. + * + * @author Scott Frederick + */ +abstract class AbstractImportsAnnotationProcessor extends AbstractProcessor { + + private final List qualifiedClassNames = new ArrayList<>(); + + abstract String getImportsFilePath(); + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latestSupported(); + } + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + for (TypeElement annotation : annotations) { + Set elements = roundEnv.getElementsAnnotatedWith(annotation); + for (Element element : elements) { + this.qualifiedClassNames.add(element.asType().toString()); + } + } + if (roundEnv.processingOver()) { + try { + writeImportsFile(); + } + catch (IOException ex) { + throw new IllegalStateException("Failed to write imports file '" + getImportsFilePath() + "'", ex); + } + } + return false; + } + + private void writeImportsFile() throws IOException { + if (!this.qualifiedClassNames.isEmpty()) { + Filer filer = this.processingEnv.getFiler(); + FileObject file = filer.createResource(StandardLocation.CLASS_OUTPUT, "", getImportsFilePath()); + try (Writer writer = new OutputStreamWriter(file.openOutputStream(), StandardCharsets.UTF_8)) { + for (String className : this.qualifiedClassNames) { + writer.append(className); + writer.append(System.lineSeparator()); + } + } + } + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/AutoConfigurationImportsAnnotationProcessor.java b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/AutoConfigurationImportsAnnotationProcessor.java index 47f1b037ba..36e32e327b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/AutoConfigurationImportsAnnotationProcessor.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/AutoConfigurationImportsAnnotationProcessor.java @@ -16,23 +16,7 @@ package org.springframework.boot.autoconfigureprocessor; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.Writer; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import javax.annotation.processing.AbstractProcessor; -import javax.annotation.processing.Filer; -import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; -import javax.lang.model.SourceVersion; -import javax.lang.model.element.Element; -import javax.lang.model.element.TypeElement; -import javax.tools.FileObject; -import javax.tools.StandardLocation; /** * Annotation processor to generate a @@ -43,47 +27,11 @@ import javax.tools.StandardLocation; * @since 3.0.0 */ @SupportedAnnotationTypes({ "org.springframework.boot.autoconfigure.AutoConfiguration" }) -public class AutoConfigurationImportsAnnotationProcessor extends AbstractProcessor { - - static final String IMPORTS_FILE_PATH = "META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports"; - - private final List qualifiedClassNames = new ArrayList<>(); +public class AutoConfigurationImportsAnnotationProcessor extends AbstractImportsAnnotationProcessor { @Override - public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latestSupported(); - } - - @Override - public boolean process(Set annotations, RoundEnvironment roundEnv) { - for (TypeElement annotation : annotations) { - Set elements = roundEnv.getElementsAnnotatedWith(annotation); - for (Element element : elements) { - this.qualifiedClassNames.add(element.asType().toString()); - } - } - if (roundEnv.processingOver()) { - try { - writeImportsFile(); - } - catch (IOException ex) { - throw new IllegalStateException("Failed to write auto-configuration imports file", ex); - } - } - return false; - } - - private void writeImportsFile() throws IOException { - if (!this.qualifiedClassNames.isEmpty()) { - Filer filer = this.processingEnv.getFiler(); - FileObject file = filer.createResource(StandardLocation.CLASS_OUTPUT, "", IMPORTS_FILE_PATH); - try (Writer writer = new OutputStreamWriter(file.openOutputStream(), StandardCharsets.UTF_8)) { - for (String className : this.qualifiedClassNames) { - writer.append(className); - writer.append(System.lineSeparator()); - } - } - } + protected String getImportsFilePath() { + return "META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports"; } } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/ManagementContextConfigurationImportsAnnotationProcessor.java b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/ManagementContextConfigurationImportsAnnotationProcessor.java new file mode 100644 index 0000000000..b5592f699f --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/java/org/springframework/boot/autoconfigureprocessor/ManagementContextConfigurationImportsAnnotationProcessor.java @@ -0,0 +1,37 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigureprocessor; + +import javax.annotation.processing.SupportedAnnotationTypes; + +/** + * Annotation processor to generate a + * {@code META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports} + * file from {@code @ManagementContextConfiguration} annotations. + * + * @author Scott Frederick + * @since 3.0.0 + */ +@SupportedAnnotationTypes({ "org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration" }) +public class ManagementContextConfigurationImportsAnnotationProcessor extends AbstractImportsAnnotationProcessor { + + @Override + protected String getImportsFilePath() { + return "META-INF/spring/org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration.imports"; + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/resources/META-INF/gradle/incremental.annotation.processors b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/resources/META-INF/gradle/incremental.annotation.processors index 1aa0f36664..212120e14c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/resources/META-INF/gradle/incremental.annotation.processors +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/resources/META-INF/gradle/incremental.annotation.processors @@ -1,2 +1,3 @@ org.springframework.boot.autoconfigureprocessor.AutoConfigureAnnotationProcessor,aggregating -org.springframework.boot.autoconfigureprocessor.AutoConfigurationImportsAnnotationProcessor,aggregating \ No newline at end of file +org.springframework.boot.autoconfigureprocessor.AutoConfigurationImportsAnnotationProcessor,aggregating +org.springframework.boot.autoconfigureprocessor.ManagementContextConfigurationImportsAnnotationProcessor,aggregating \ No newline at end of file diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor index 123f57ce96..ab77082ba2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor @@ -1,2 +1,3 @@ org.springframework.boot.autoconfigureprocessor.AutoConfigureAnnotationProcessor org.springframework.boot.autoconfigureprocessor.AutoConfigurationImportsAnnotationProcessor +org.springframework.boot.autoconfigureprocessor.ManagementContextConfigurationImportsAnnotationProcessor diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigurationImportsAnnotationProcessorTests.java b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigurationImportsAnnotationProcessorTests.java index a3f1da9529..67b59e1d6d 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigurationImportsAnnotationProcessorTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/AutoConfigurationImportsAnnotationProcessorTests.java @@ -32,7 +32,7 @@ import org.springframework.boot.testsupport.compiler.TestCompiler; import static org.assertj.core.api.Assertions.assertThat; /** - * Tests for {@link TestAutoConfigurationImportsAnnotationProcessor}. + * Tests for {@link AutoConfigurationImportsAnnotationProcessor}. * * @author Scott Frederick */ @@ -67,11 +67,11 @@ class AutoConfigurationImportsAnnotationProcessorTests { private List compile(Class... types) throws IOException { TestAutoConfigurationImportsAnnotationProcessor processor = new TestAutoConfigurationImportsAnnotationProcessor(); this.compiler.getTask(types).call(processor); - return getWrittenImports(); + return getWrittenImports(processor.getImportsFilePath()); } - private List getWrittenImports() throws IOException { - File file = getWrittenFile(); + private List getWrittenImports(String importsFilePath) throws IOException { + File file = new File(this.tempDir, importsFilePath); if (!file.exists()) { return null; } @@ -79,8 +79,4 @@ class AutoConfigurationImportsAnnotationProcessorTests { return reader.lines().collect(Collectors.toList()); } - private File getWrittenFile() { - return new File(this.tempDir, AutoConfigurationImportsAnnotationProcessor.IMPORTS_FILE_PATH); - } - } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/ManagementContextConfigurationImportsAnnotationProcessorTests.java b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/ManagementContextConfigurationImportsAnnotationProcessorTests.java new file mode 100644 index 0000000000..56e3818f48 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/ManagementContextConfigurationImportsAnnotationProcessorTests.java @@ -0,0 +1,82 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigureprocessor; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.List; +import java.util.stream.Collectors; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import org.springframework.boot.testsupport.compiler.TestCompiler; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * Tests for {@link ManagementContextConfigurationImportsAnnotationProcessor}. + * + * @author Scott Frederick + */ +class ManagementContextConfigurationImportsAnnotationProcessorTests { + + @TempDir + File tempDir; + + private TestCompiler compiler; + + @BeforeEach + void createCompiler() throws IOException { + this.compiler = new TestCompiler(this.tempDir); + } + + @Test + void annotatedClasses() throws Exception { + List classes = compile(TestManagementContextConfigurationOne.class, + TestManagementContextConfigurationTwo.class); + assertThat(classes).hasSize(2); + assertThat(classes).containsExactly( + "org.springframework.boot.autoconfigureprocessor.TestManagementContextConfigurationOne", + "org.springframework.boot.autoconfigureprocessor.TestManagementContextConfigurationTwo"); + } + + @Test + void notAnnotatedClasses() throws Exception { + List classes = compile(TestAutoConfigurationConfiguration.class); + assertThat(classes).isNull(); + } + + private List compile(Class... types) throws IOException { + TestManagementContextConfigurationImportsAnnotationProcessor processor = new TestManagementContextConfigurationImportsAnnotationProcessor(); + this.compiler.getTask(types).call(processor); + return getWrittenImports(processor.getImportsFilePath()); + } + + private List getWrittenImports(String importsFilePath) throws IOException { + File file = new File(this.tempDir, importsFilePath); + if (!file.exists()) { + return null; + } + BufferedReader reader = new BufferedReader(new FileReader(file)); + return reader.lines().collect(Collectors.toList()); + } + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfiguration.java b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfiguration.java new file mode 100644 index 0000000000..45d9ebd0a7 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfiguration.java @@ -0,0 +1,36 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigureprocessor; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Alternative to {@code @ManagementContextConfiguration} for testing (removes the need + * for a dependency on the real annotation). + * + * @author Scott Frederick + */ +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface TestManagementContextConfiguration { + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationImportsAnnotationProcessor.java b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationImportsAnnotationProcessor.java new file mode 100644 index 0000000000..309c1751a2 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationImportsAnnotationProcessor.java @@ -0,0 +1,31 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigureprocessor; + +import javax.annotation.processing.SupportedAnnotationTypes; + +/** + * An extension of {@link ManagementContextConfigurationImportsAnnotationProcessor} used + * for testing. + * + * @author Scott Frederick + */ +@SupportedAnnotationTypes({ "org.springframework.boot.autoconfigureprocessor.TestManagementContextConfiguration" }) +public class TestManagementContextConfigurationImportsAnnotationProcessor + extends ManagementContextConfigurationImportsAnnotationProcessor { + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationOne.java b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationOne.java new file mode 100644 index 0000000000..7e4dff6fc8 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationOne.java @@ -0,0 +1,27 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigureprocessor; + +/** + * Test {@code ManagementContextConfiguration} class. + * + * @author Scott Frederick + */ +@TestManagementContextConfiguration +class TestManagementContextConfigurationOne { + +} diff --git a/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationTwo.java b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationTwo.java new file mode 100644 index 0000000000..e99fdb35d1 --- /dev/null +++ b/spring-boot-project/spring-boot-tools/spring-boot-autoconfigure-processor/src/test/java/org/springframework/boot/autoconfigureprocessor/TestManagementContextConfigurationTwo.java @@ -0,0 +1,27 @@ +/* + * Copyright 2012-2022 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigureprocessor; + +/** + * Test {@code ManagementContextConfiguration} class. + * + * @author Scott Frederick + */ +@TestManagementContextConfiguration +class TestManagementContextConfigurationTwo { + +}