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

Make it easier to register mock components from within Test suites

    Details

    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Example:

      @RunWith(RenderingTestSuite.class)
      public class IntegrationTests
      {
          @RenderingTestSuite.Initialized
          public void initialize(MockingComponentManager componentManager) throws Exception
          {
              Mockery mockery = new JUnit4Mockery();
      
              final ModelContext modelContext = componentManager.registerMockComponent(mockery, ModelContext.class);
              mockery.checking(new Expectations() {{
                  allowing(modelContext).getCurrentEntityReference();
                      will(returnValue(new WikiReference("currentWiki")));
              }});
      ...
      

        Attachments

          Activity

            People

            • Assignee:
              vmassol Vincent Massol
              Reporter:
              vmassol Vincent Massol
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: