Search in sources :

Example 11 with DestinationResolutionException

use of org.springframework.jms.support.destination.DestinationResolutionException in project webcert by sklintyg.

the class NotificationServiceImplTest method testDraftDeletedJmsException.

@Test(expected = JmsException.class)
public void testDraftDeletedJmsException() throws Exception {
    doThrow(new DestinationResolutionException("")).when(template).send(any(MessageCreator.class));
    try {
        notificationService.sendNotificationForDraftDeleted(createUtkast());
    } finally {
        verify(template).send(any(MessageCreator.class));
        verifyZeroInteractions(mockMonitoringLogService);
    }
}
Also used : DestinationResolutionException(org.springframework.jms.support.destination.DestinationResolutionException) MessageCreator(org.springframework.jms.core.MessageCreator) Test(org.junit.Test)

Example 12 with DestinationResolutionException

use of org.springframework.jms.support.destination.DestinationResolutionException in project webcert by sklintyg.

the class NotificationServiceImplTest method testDraftChangedJmsException.

@Test(expected = JmsException.class)
public void testDraftChangedJmsException() throws Exception {
    doThrow(new DestinationResolutionException("")).when(template).send(any(MessageCreator.class));
    try {
        notificationService.sendNotificationForDraftChanged(createUtkast());
    } finally {
        verify(template).send(any(MessageCreator.class));
        verifyZeroInteractions(mockMonitoringLogService);
    }
}
Also used : DestinationResolutionException(org.springframework.jms.support.destination.DestinationResolutionException) MessageCreator(org.springframework.jms.core.MessageCreator) Test(org.junit.Test)

Example 13 with DestinationResolutionException

use of org.springframework.jms.support.destination.DestinationResolutionException in project webcert by sklintyg.

the class NotificationServiceImplTest method testDraftSignedJmsException.

@Test(expected = JmsException.class)
public void testDraftSignedJmsException() throws Exception {
    doThrow(new DestinationResolutionException("")).when(template).send(any(MessageCreator.class));
    try {
        notificationService.sendNotificationForDraftSigned(createUtkast());
    } finally {
        verify(template).send(any(MessageCreator.class));
        verifyZeroInteractions(mockMonitoringLogService);
    }
}
Also used : DestinationResolutionException(org.springframework.jms.support.destination.DestinationResolutionException) MessageCreator(org.springframework.jms.core.MessageCreator) Test(org.junit.Test)

Aggregations

DestinationResolutionException (org.springframework.jms.support.destination.DestinationResolutionException)13 Test (org.junit.Test)12 MessageCreator (org.springframework.jms.core.MessageCreator)12 JMSException (jakarta.jms.JMSException)1 LogRequest (se.inera.intyg.webcert.web.service.log.dto.LogRequest)1