Class TestCaseMockTool

java.lang.Object
ch.admin.bit.jeap.testorchestrator.testsupport.TestCaseMockTool

public class TestCaseMockTool extends Object
Support class for unit testing test cases with Mockito mocks playing the part of the test agent web client and the test report service. Provides some methods to verify the common calls that test cases make to test agents and to the report service. Also provides some methods to mock the behaviour of test agents in the act phase.
  • Method Details

    • mockPrepareCall

      public void mockPrepareCall(String testAgentName, ch.admin.bit.jeap.testagent.api.prepare.PreparationResultDto preparationResultDto)
    • assertPrepareCalled

      public ch.admin.bit.jeap.testagent.api.prepare.PreparationDto assertPrepareCalled(String testAgentName, String testCase)
    • mockActCall

      public void mockActCall(String testAgentName, Supplier<ch.admin.bit.jeap.testagent.api.act.ActionResultDto> act)
    • mockActCall

      public void mockActCall(String testAgentName, ch.admin.bit.jeap.testagent.api.act.ActionDto actionDto, Supplier<ch.admin.bit.jeap.testagent.api.act.ActionResultDto> act)
    • assertActCalled

      public ch.admin.bit.jeap.testagent.api.act.ActionDto assertActCalled(String testAgentName, String action)
    • assertActsCalled

      public List<ch.admin.bit.jeap.testagent.api.act.ActionDto> assertActsCalled(String testAgentName, String... actions)
      If there are several Actions which call act, you must use this for Assertion
      Parameters:
      testAgentName - the Name of the TestAgent
      actions - can be more than one
      Returns:
      A List of ActionDto's
    • assertUpdateCalled

      public ch.admin.bit.jeap.testagent.api.update.DynamicDataDto assertUpdateCalled(String testAgentName)
    • assertVerifyCalled

      public void assertVerifyCalled(String... testAgentNames)
    • assertPersistTestResultCalled

      public List<ch.admin.bit.jeap.testagent.api.verify.ReportDto> assertPersistTestResultCalled(int times)
    • assertDeleteCalled

      public void assertDeleteCalled(String... testAgentNames)
    • assertNoMoreTestAgentWebClientInteractions

      public void assertNoMoreTestAgentWebClientInteractions()
    • assertNoMoreTestReportServiceInteractions

      public void assertNoMoreTestReportServiceInteractions()
    • builder