mardi 5 juillet 2016

Mockito check passed params [duplicate]

This question already has an answer here:

I'm currently working on replacing dummy Objects with mocked Objects... I have the following Code snippet, and I would like to recreate it using Mocks only:

mock.setDisplay(new DummyDisplay() {
      @Override
      public void listSteps(List<String> steps) {
        for (String s : steps) {
          assertFalse(s.contains(StepStrings.WITHDRAW));
        }
      }
    });

when(displayMock.listSteps(anyListOf(String.class))).thenAnswer() won't work since listSteps is returning void. Any ideas on how to do this?

Aucun commentaire:

Enregistrer un commentaire