use of org.springframework.boot.configurationprocessor.test.TestableAnnotationProcessor 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);
}
use of org.springframework.boot.configurationprocessor.test.TestableAnnotationProcessor in project spring-boot by spring-projects.
the class PropertyDescriptorTests method process.
protected void process(Class<?> target, BiConsumer<RoundEnvironmentTester, MetadataGenerationEnvironment> consumer) throws IOException {
TestableAnnotationProcessor<MetadataGenerationEnvironment> processor = new TestableAnnotationProcessor<>(consumer, new MetadataGenerationEnvironmentFactory());
TestCompiler compiler = new TestCompiler(this.tempDir);
compiler.getTask(target).call(processor);
}
use of org.springframework.boot.configurationprocessor.test.TestableAnnotationProcessor in project spring-boot by spring-projects.
the class TypeUtilsTests method process.
private void process(Class<?> target, BiConsumer<RoundEnvironmentTester, TypeUtils> consumer) throws IOException {
TestableAnnotationProcessor<TypeUtils> processor = new TestableAnnotationProcessor<>(consumer, TypeUtils::new);
TestCompiler compiler = new TestCompiler(this.tempDir);
compiler.getTask(target).call(processor);
}
Aggregations