-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: testIssues in the test moduleIssues in the test modulestatus: duplicateA duplicate of another issueA duplicate of another issue
Description
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
@DiritiesContextto 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:
- Dependency injection of @Configurable objects should work across test suites [SPR-6121] #10789 Dependency injection of
@Configurableobjects should work across test suites ("duplicates")
Metadata
Metadata
Assignees
Labels
in: testIssues in the test moduleIssues in the test modulestatus: duplicateA duplicate of another issueA duplicate of another issue