@Test public void backupResponse_whenInvocationMissing_thenNothingBadHappens() { Invocation invocation = newInvocation(); long callId = invocation.op.getCallId(); invocationRegistry.register(invocation); invocationRegistry.deregister(invocation); invocationRegistry.notifyBackupComplete(callId); assertNull(invocationRegistry.get(callId)); }
@Test public void backupResponse_whenInvocationExist() { Invocation invocation = newInvocation(); invocationRegistry.register(invocation); long callId = invocation.op.getCallId(); Object value = "foo"; invocationRegistry.notifyNormalResponse(callId, value, 1, null); assertSame(invocation, invocationRegistry.get(callId)); invocationRegistry.notifyBackupComplete(callId); assertNull(invocationRegistry.get(callId)); assertEquals(value, invocation.future.join()); }