Class MockProblemChangeDirector

  • All Implemented Interfaces:
    ProblemChangeDirector

    public class MockProblemChangeDirector
    extends Object
    implements ProblemChangeDirector
    Use for unit-testing ProblemChanges. Together with Mockito this class makes it possible to verify that a ProblemChange implementation correctly calls methods of the ProblemChangeDirector. Example of usage:
     java
      MockProblemChangeDirector mockProblemChangeDirector = spy(new MockProblemChangeDirector());
      ProblemChange problemChange = new MyProblemChange(removedEntity);
      problemChange.doChange(solution, mockProblemChangeDirector);
      verify(mockProblemChangeDirector).removeEntity(same(removedEntity), any());