Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-455

The test framework mocking CM should mock a dependency only if it does not already exist in the CM

    XMLWordPrintable

Details

    • N/A

    Description

      Right now when using MockitoComponentMockingRule all dependencies of the passed component produce related mocks registered into the ComponentManager even if you indicate that you wanted this component to be realy loaded with @ComponentList or @AllComponents.

      This behavior should be moved to mocking only if the component does not already exist in the CM. The uses case where you really want to override during tested component some dependency you asked to load is very rare and is doable with the @AfterComponent annotation. We would not loose any use case and make other use cases easier to write and understand.

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            tmortagne Thomas Mortagne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: