Class InjectModule.InjectTestListener

    • Constructor Detail

      • InjectTestListener

        protected InjectTestListener()
    • Method Detail

      • beforeTestMethod

        public void beforeTestMethod​(Object testObject,
                                     Method testMethod)
        Before executing a test method (i.e. after the fixture methods), the injection is performed, since objects to inject or targets are possibly instantiated during the fixture.
        Overrides:
        beforeTestMethod in class TestListener
        Parameters:
        testObject - The test object, not null
        testMethod - The test method, not null
      • afterTestMethod

        public void afterTestMethod​(Object testObject,
                                    Method testMethod,
                                    Throwable throwable)
        After test execution, if requested restore all values that were replaced in the static injection.
        Overrides:
        afterTestMethod in class TestListener
        Parameters:
        testObject - The test object, not null
        testMethod - The test method, not null
        throwable - The throwable thrown during the test, null if none was thrown