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

Make it easier to register mock components from within Test suites

    XMLWordPrintable

Details

    • N/A
    • N/A

    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

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

            Dates

              Created:
              Updated:
              Resolved: