Mockito Polishing
`$ find spring-integration-* | grep '\.java$' | xargs sed -E -i '' -e 's/(\(?)\(([^<()]*)\) *invocation.getArguments\(\)\[([0-9]*)\]/\1invocation.getArgumentAt(\3, \2.class)/'`
This commit is contained in:
committed by
Artem Bilan
parent
9225c514fe
commit
c5fbd93787
@@ -61,7 +61,7 @@ public class XmppHeaderEnricherParserTests {
|
||||
MessageHandler handler = mock(MessageHandler.class);
|
||||
doAnswer(new Answer() {
|
||||
public Object answer(InvocationOnMock invocation) throws Throwable {
|
||||
Message message = (Message) invocation.getArguments()[0];
|
||||
Message message = invocation.getArgumentAt(0, Message.class);
|
||||
String chatToUser = (String) message.getHeaders().get(XmppHeaders.TO);
|
||||
assertNotNull(chatToUser);
|
||||
assertEquals("test1@example.org", chatToUser);
|
||||
|
||||
@@ -85,7 +85,7 @@ public class ChatMessageListeningEndpointTests {
|
||||
|
||||
@Override
|
||||
public Object answer(InvocationOnMock invocation) throws Throwable {
|
||||
packetListSet.add((StanzaListener) invocation.getArguments()[0]);
|
||||
packetListSet.add(invocation.getArgumentAt(0, StanzaListener.class));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class PresenceListeningEndpointTests {
|
||||
|
||||
@Override
|
||||
public Object answer(InvocationOnMock invocation) throws Throwable {
|
||||
rosterSet.add((RosterListener) invocation.getArguments()[0]);
|
||||
rosterSet.add(invocation.getArgumentAt(0, RosterListener.class));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class PresenceListeningEndpointTests {
|
||||
|
||||
@Override
|
||||
public Object answer(InvocationOnMock invocation) throws Throwable {
|
||||
rosterSet.remove((RosterListener) invocation.getArguments()[0]);
|
||||
rosterSet.remove(invocation.getArgumentAt(0, RosterListener.class));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user