コード例 #1
0
 @Test
 public void testOnMessageShouldSendResponseToLoggerQueue() throws JMSException {
   // GIVEN
   given(objectMessage.getObject()).willReturn(response);
   given(response.isLoggingEnabled()).willReturn(true);
   underTest.setMessageLoggingEnabled(true);
   // WHEN
   underTest.onMessage(objectMessage);
   // THEN
   verify(jmsTemplate).send(loggerQueue, jmsResponseMessageCreator);
 }
コード例 #2
0
 @Test
 public void testOnMessageShouldCallSequenceManagerToSaveTheResponse() throws JMSException {
   // GIVEN
   underTest.setMessageLoggingEnabled(true);
   given(response.isLoggingEnabled()).willReturn(true);
   given(objectMessage.getObject()).willReturn(response);
   // WHEN
   underTest.onMessage(objectMessage);
   // THEN
   verify(manager).tryToSaveResponseIntoSequence(response);
 }
コード例 #3
0
 @Test
 public void testLogRequestShouldNotSendMessageToQueueWhenSafeGuarded() throws JMSException {
   // GIVEN
   given(objectMessage.getObject()).willReturn(response);
   given(response.isLoggingEnabled()).willReturn(true);
   underTest.setMessageLoggingEnabled(false);
   // WHEN
   underTest.onMessage(objectMessage);
   // THEN
   verifyZeroInteractions(jmsTemplate);
 }
コード例 #4
0
 @Test(expectedExceptions = SystemException.class)
 public void testOnMessageShouldThrowNewRuntimeExceptionWhenCannotGetWilmaResponseFromMessage()
     throws JMSException {
   // GIVEN
   underTest.setMessageLoggingEnabled(true);
   given(response.isLoggingEnabled()).willReturn(true);
   given(objectMessage.getObject()).willThrow(new JMSException("exception"));
   // WHEN
   underTest.onMessage(objectMessage);
   // THEN exception should be thrown
 }
コード例 #5
0
 @Test
 public void testOnMessageShouldDecompressResponse() throws ApplicationException, JMSException {
   // GIVEN
   underTest.setFiDecompressionEnabled(true);
   underTest.setMessageLoggingEnabled(true);
   given(response.isLoggingEnabled()).willReturn(true);
   given(objectMessage.getObject()).willReturn(response);
   // WHEN
   underTest.onMessage(objectMessage);
   // THEN
   verify(messageExtractor).extract(response);
 }