use of org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest in project herd by FINRAOS.
the class NotificationRegistrationStatusRestControllerTest method testUpdateNotificationRegistrationStatusAssertSuccess.
@Test
public void testUpdateNotificationRegistrationStatusAssertSuccess() {
NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME);
NotificationRegistrationStatusUpdateRequest request = new NotificationRegistrationStatusUpdateRequest(NotificationRegistrationStatusEntity.DISABLED);
NotificationRegistrationStatusUpdateResponse response = new NotificationRegistrationStatusUpdateResponse(notificationRegistrationKey, NotificationRegistrationStatusEntity.DISABLED);
when(notificationRegistrationStatusService.updateNotificationRegistrationStatus(NAMESPACE, NOTIFICATION_NAME, request)).thenReturn(response);
NotificationRegistrationStatusUpdateResponse resultResponse = notificationRegistrationStatusRestController.updateNotificationRegistrationStatus(NAMESPACE, NOTIFICATION_NAME, request);
// Verify the external calls.
verify(notificationRegistrationStatusService).updateNotificationRegistrationStatus(NAMESPACE, NOTIFICATION_NAME, request);
verifyNoMoreInteractions(notificationRegistrationStatusService);
// Validate the returned object.
assertEquals(response, resultResponse);
}
use of org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest in project herd by FINRAOS.
the class NotificationRegistrationStatusServiceTest method testUpdateNotificationRegistrationStatusAssertUpdateSuccess.
@Test
public void testUpdateNotificationRegistrationStatusAssertUpdateSuccess() {
NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME);
notificationRegistrationDaoTestHelper.createBusinessObjectDataNotificationRegistrationEntity(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS, notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
NotificationRegistrationStatusUpdateResponse response = notificationRegistrationStatusService.updateNotificationRegistrationStatus(NAMESPACE, NOTIFICATION_NAME, new NotificationRegistrationStatusUpdateRequest(NotificationRegistrationStatusEntity.DISABLED));
assertEquals(new NotificationRegistrationStatusUpdateResponse(notificationRegistrationKey, NotificationRegistrationStatusEntity.DISABLED), response);
}
use of org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest in project herd by FINRAOS.
the class NotificationRegistrationStatusServiceTest method testUpdateNotificationRegistrationStatusAssertThrowWhenNameNull.
@Test
public void testUpdateNotificationRegistrationStatusAssertThrowWhenNameNull() {
try {
notificationRegistrationStatusService.updateNotificationRegistrationStatus(NAMESPACE, null, new NotificationRegistrationStatusUpdateRequest(NotificationRegistrationStatusEntity.DISABLED));
fail();
} catch (Exception e) {
assertEquals(IllegalArgumentException.class, e.getClass());
assertEquals("The notification name must be specified", e.getMessage());
}
}
use of org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest in project herd by FINRAOS.
the class NotificationRegistrationStatusServiceTest method testUpdateNotificationRegistrationStatusAssertThrowWhenNameBlank.
@Test
public void testUpdateNotificationRegistrationStatusAssertThrowWhenNameBlank() {
try {
notificationRegistrationStatusService.updateNotificationRegistrationStatus(NAMESPACE, BLANK_TEXT, new NotificationRegistrationStatusUpdateRequest(NotificationRegistrationStatusEntity.DISABLED));
fail();
} catch (Exception e) {
assertEquals(IllegalArgumentException.class, e.getClass());
assertEquals("The notification name must be specified", e.getMessage());
}
}
use of org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest in project herd by FINRAOS.
the class NotificationRegistrationStatusServiceTest method testUpdateNotificationRegistrationStatusAssertThrowWhenNamespaceNull.
@Test
public void testUpdateNotificationRegistrationStatusAssertThrowWhenNamespaceNull() {
try {
notificationRegistrationStatusService.updateNotificationRegistrationStatus(null, NOTIFICATION_NAME, new NotificationRegistrationStatusUpdateRequest(NotificationRegistrationStatusEntity.DISABLED));
fail();
} catch (Exception e) {
assertEquals(IllegalArgumentException.class, e.getClass());
assertEquals("The namespace must be specified", e.getMessage());
}
}
Aggregations