Simplify BatchTestContextCustomizerFactory
Since @SpringBatchTest is effectively a marker annotation from the perspective of BatchTestContextCustomizerFactory, there is no need to retrieve the merged, synthesized annotation. Checking for the presence of @SpringBatchTest is sufficient.
This commit is contained in:
committed by
Mahmoud Ben Hassine
parent
50f400cf5a
commit
d9bbb0ecda
@@ -32,8 +32,7 @@ public class BatchTestContextCustomizerFactory implements ContextCustomizerFacto
|
||||
|
||||
@Override
|
||||
public ContextCustomizer createContextCustomizer(Class<?> testClass, List<ContextConfigurationAttributes> configAttributes) {
|
||||
SpringBatchTest springBatchTest = AnnotatedElementUtils.findMergedAnnotation(testClass, SpringBatchTest.class);
|
||||
if (springBatchTest != null) {
|
||||
if (AnnotatedElementUtils.hasAnnotation(testClass, SpringBatchTest.class)) {
|
||||
return new BatchTestContextCustomizer();
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user