-
Bug
-
Resolution: Fixed
-
Neutral
-
None
Steps to reproduce
Call ComponentsTestUtil.clear() in an @AfterEach method in a @MagnoliaRepositoryTest annotated test.
Expected results
All existing tests pass.
Actual results
All tests fail:
info.magnolia.objectfactory.MgnlInstantiationException: No concrete implementation defined for interface info.magnolia.context.SystemContext at info.magnolia.test.mock.AbstractComponentProvider.getComponent(AbstractComponentProvider.java:157) ~[test-classes/:?] at info.magnolia.objectfactory.Components.getComponent(Components.java:107) ~[classes/:?] at info.magnolia.context.ContextFactory.getSystemContext(ContextFactory.java:63) ~[classes/:?] at info.magnolia.context.MgnlContext.getSystemContext(MgnlContext.java:347) ~[classes/:?] at info.magnolia.context.MgnlContext.release(MgnlContext.java:615) ~[classes/:?] at info.magnolia.test.juni5.RepositorySupport.afterEach(RepositorySupport.java:115) ~[test-classes/:?]
Development notes
ComponentsTestUtil.clear() interferes with the setup/tear down of the extensions. This is a problem of ComponentsTestUtil.clear() being too intrusive violating JUnit 5's "wrapping behaviour". (For the same reason ComponentsTestUtil.clear() needs to be placed after super.tearDown() instead of before currently). IMO this needs to fixed in ComponentsTestUtil by introducing means for resetting the component provider to its previous state instead of just clearing it.
Acceptance criteria
- relates to
-
MAGNOLIA-8188 Lightweight repository setup for tests
- Closed