use of org.springframework.jms.support.destination.DestinationResolutionException in project webcert by sklintyg.
the class LogServiceImplTest method logServiceJmsException.
@Test(expected = JmsException.class)
public void logServiceJmsException() throws Exception {
when(userService.getUser()).thenReturn(createUser());
doThrow(new DestinationResolutionException("")).when(template).send(any(MessageCreator.class));
LogRequest logRequest = new LogRequest();
logRequest.setIntygId("abc123");
logRequest.setPatientId(createPnr("19121212-1212"));
logRequest.setPatientName("Hans Olof van der Test");
try {
logService.logReadIntyg(logRequest);
} finally {
verify(template, times(1)).send(any(MessageCreator.class));
}
}
use of org.springframework.jms.support.destination.DestinationResolutionException in project webcert by sklintyg.
the class NotificationServiceImplTest method testIntygRevokedJmsException.
@Test(expected = JmsException.class)
public void testIntygRevokedJmsException() throws Exception {
when(utkastRepo.findOne(INTYG_ID)).thenReturn(createUtkast());
doThrow(new DestinationResolutionException("")).when(template).send(any(MessageCreator.class));
try {
notificationService.sendNotificationForIntygRevoked(INTYG_ID);
} finally {
// verify(template).send(any(MessageCreator.class));
// verifyZeroInteractions(mockMonitoringLogService);
}
}
use of org.springframework.jms.support.destination.DestinationResolutionException in project webcert by sklintyg.
the class NotificationServiceImplTest method testAnswerRecievedArendeIntegreradEnhetJmsException.
@Test(expected = JmsException.class)
public void testAnswerRecievedArendeIntegreradEnhetJmsException() throws Exception {
when(integreradeEnheterRegistry.isEnhetIntegrerad(ENHET_ID, INTYG_TYP_FK)).thenReturn(true);
when(utkastRepo.findOne(INTYG_ID)).thenReturn(createUtkast());
doThrow(new DestinationResolutionException("")).when(template).send(any(MessageCreator.class));
try {
notificationService.sendNotificationForAnswerRecieved(createArende());
} finally {
verify(template).send(any(MessageCreator.class));
verifyZeroInteractions(mockMonitoringLogService);
}
}
use of org.springframework.jms.support.destination.DestinationResolutionException in project webcert by sklintyg.
the class NotificationServiceImplTest method testQuestionReceivedFragaSvarIntegreradEnhetJmsException.
@Test(expected = JmsException.class)
public void testQuestionReceivedFragaSvarIntegreradEnhetJmsException() throws Exception {
when(integreradeEnheterRegistry.isEnhetIntegrerad(ENHET_ID, INTYG_TYP_FK)).thenReturn(true);
when(utkastRepo.findOne(INTYG_ID)).thenReturn(createUtkast());
doThrow(new DestinationResolutionException("")).when(template).send(any(MessageCreator.class));
try {
notificationService.sendNotificationForQuestionReceived(createFragaSvar());
} finally {
verify(template).send(any(MessageCreator.class));
verifyZeroInteractions(mockMonitoringLogService);
}
}
use of org.springframework.jms.support.destination.DestinationResolutionException in project webcert by sklintyg.
the class NotificationServiceImplTest method testQuestionReceivedArendeIntegreradEnhetJmsException.
@Test(expected = JmsException.class)
public void testQuestionReceivedArendeIntegreradEnhetJmsException() throws Exception {
when(integreradeEnheterRegistry.isEnhetIntegrerad(ENHET_ID, INTYG_TYP_FK)).thenReturn(true);
when(utkastRepo.findOne(INTYG_ID)).thenReturn(createUtkast());
doThrow(new DestinationResolutionException("")).when(template).send(any(MessageCreator.class));
try {
notificationService.sendNotificationForQuestionReceived(createArende());
} finally {
verify(template).send(any(MessageCreator.class));
verifyZeroInteractions(mockMonitoringLogService);
}
}
Aggregations