I want to be sure that mocked is called with specific set of strings as parameter. For example, I have the following code:
public class SomeLogic {
@Autowired
private SpecificService specificService;
public void action() {
Set<String> args = fillArgsMethod();
specificService.handleArgs(args);
}
}
And my current try to test it is the following
@Mock
private SpecificService specificService
@InjectMocks
private SomeLogic someLogic;
@Test
public void testAction() {
someLogic.action();
verify(specificService).handleArgs(anySet());
}
But I want to be sure, that handleArgs() will receive the exact set of strings, that I expect. How can I modify verifying to check that handleArgs is called with set "first","second"? Thanks