Mockito - Invalid use of argument matchers

For future readers. This will save you a lot of time.

We cannot use argument matcher and primitive/raw values together.

when(fooService.getResult("string",any(MyClass.class))).thenReturn(1); // will give error

when(fooService.getResult(anyString(),any(MyClass.class))).thenReturn(1); // correct

I think the rest of the message tells you what the problem is. When you use an argument matcher for one of the arguments, all the other arguments must also use an argument matcher:

Mockito.verify(mockTemplate, Mockito.times(1)).send(
    Mockito.eq("appointment.queue"), 
    Mockito.any(MessageCreator.class));