【发布时间】:2020-09-09 18:14:29
【问题描述】:
@Test
public void successfulHandshake(){
HandshakeImpl1Server handShake = new HandshakeImpl1Server();
handShake.setHttpStatus((short) 101);
authUnderTest.authenticate(callback);
doAnswer(invocation -> {
websocket.onOpen(handShake);
return null;
}).when(websocket).open();
verify(websocket,times(1)).send(any(String.class));
}
doAnswer 永远不会被调用。有什么想法吗?
【问题讨论】:
标签: java android testing mockito