I have the following call to match so as to return an object:
String[][] parameters = new String[][] {
new String[]{
eq("provider"),
eq("myProvider")
}
};
when(supportApiNotificationsProvider.getByServiceName(
"supportApiNotifications",
parameters))
.thenReturn(<an-object>);
but this way the mock always returns null
. On the other hand, if I change the parameter offered to the mock as the following:
String[][] parameters = new String[][] {
new String[]{
anyString(),
anyString()
}
};
it works! I'm sure about the tho string values passed, hence I guess it's something about the eq
matchers I defined.
I think the
eq
is misplaced, I would rather defineparameters
like this: