私は以下のコードを持っています
public void testInitializeButtons() {
model.initializeButtons();
verify(controller, times(1)).sendMessage(
eq(new Message(eq(Model.OutgoingMessageTypes.BUTTON_STATUSES_CHANGED),
eq(new ButtonStatus(anyBoolean(), eq(false), eq(false), eq(false), eq(false))),
anyObject())));
}
次の例外をスローします
org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
Invalid use of argument matchers!
1 matchers expected, 9 recorded.
This exception may occur if matchers are combined with raw values:
//incorrect:
someMethod(anyObject(), "raw String");
When using matchers, all arguments have to be provided by matchers.
For example:
//correct:
someMethod(anyObject(), eq("String by matcher"));
For more info see javadoc for Matchers class.
at se.cambiosys.client.medicalrecords.model.MedicalRecordPanelModelTest.testInitializeButtons(MedicalRecordPanelModelTest.java:88)
誰かがテストを正しく書く方法を教えてもらえますか?