use of org.springframework.boot.configurationprocessor.test.RoundEnvironmentTester in project spring-boot by spring-projects.
the class PropertyDescriptorResolverTests method process.
private void process(Class<?> target, Collection<Class<?>> additionalClasses, BiConsumer<TypeElement, MetadataGenerationEnvironment> consumer) throws IOException {
BiConsumer<RoundEnvironmentTester, MetadataGenerationEnvironment> internalConsumer = (roundEnv, metadataEnv) -> {
TypeElement element = roundEnv.getRootElement(target);
consumer.accept(element, metadataEnv);
};
TestableAnnotationProcessor<MetadataGenerationEnvironment> processor = new TestableAnnotationProcessor<>(internalConsumer, new MetadataGenerationEnvironmentFactory());
TestCompiler compiler = new TestCompiler(this.tempDir);
ArrayList<Class<?>> allClasses = new ArrayList<>();
allClasses.add(target);
allClasses.addAll(additionalClasses);
compiler.getTask(allClasses.toArray(new Class<?>[0])).call(processor);
}
Aggregations