Andreas Eternach opened SPR-11363 and commented
Hello,
i have two test classes:
First testclass: derived from class AbstractTestNGSpringContextTests, uses annotation @EnableSpringConfigured
Second testclass: plain TestNG-Test without spring context, tries to instantiate a @Configurable-annotated-class
Maven runs the testcases in the order given above. When the second testclass is run and the @Configurable-annotated-class is constructed, a NoSuchBeanDefinitionEception is thrown.
I assume that the spring-context of the first testclass is not automatically destroyed.
Further investigation showed:
- adding
@DiritiesContext to the first testclass resolves the problem.
- running AnnotationBeanConfigurerAspect.aspectOf().destroy() before the second test-class is executed resolves the problem.
Best Regards, Andreas
Affects: 3.2.6
Issue Links:
Andreas Eternach opened SPR-11363 and commented
Hello,
i have two test classes:
First testclass: derived from class AbstractTestNGSpringContextTests, uses annotation
@EnableSpringConfiguredSecond testclass: plain TestNG-Test without spring context, tries to instantiate a
@Configurable-annotated-classMaven runs the testcases in the order given above. When the second testclass is run and the
@Configurable-annotated-classis constructed, a NoSuchBeanDefinitionEception is thrown.I assume that the spring-context of the first testclass is not automatically destroyed.
Further investigation showed:
@DiritiesContextto the first testclass resolves the problem.Best Regards, Andreas
Affects: 3.2.6
Issue Links:
@Configurableobjects should work across test suites ("duplicates")