コード例 #1
0
 @Test
 public void invalid() throws Exception {
   when(mockTemplate.validateMessage()).thenReturn(false);
   new ValidationPhase().runPhase(mockTemplate, mockContext, mockPhaseResultNotifier);
   verify(mockTemplate, times(1)).discardInvalidMessage();
   verify(mockPhaseResultNotifier, Mockito.times(1)).phaseConsumedMessage();
 }
コード例 #2
0
 @Test
 public void validationFails() throws Exception {
   when(mockTemplate.validateMessage()).thenReturn(false);
   doThrow(mockMulException).when(mockTemplate).discardInvalidMessage();
   new ValidationPhase().runPhase(mockTemplate, mockContext, mockPhaseResultNotifier);
   verify(mockPhaseResultNotifier, Mockito.times(1)).phaseFailure(mockMulException);
 }
コード例 #3
0
 @Test
 public void valid() {
   when(mockTemplate.validateMessage()).thenReturn(true);
   new ValidationPhase().runPhase(mockTemplate, mockContext, mockPhaseResultNotifier);
   verify(mockPhaseResultNotifier, Mockito.times(1)).phaseSuccessfully();
 }