use of org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest in project herd by FINRAOS.
the class NotificationRegistrationStatusServiceTest method testUpdateNotificationRegistrationStatusAssertUpdateSuccessTrim.
@Test
public void testUpdateNotificationRegistrationStatusAssertUpdateSuccessTrim() {
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(addWhitespace(NAMESPACE), addWhitespace(NOTIFICATION_NAME), new NotificationRegistrationStatusUpdateRequest(addWhitespace(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 testUpdateNotificationRegistrationStatusAssertThrowWhenNamespaceBlank.
@Test
public void testUpdateNotificationRegistrationStatusAssertThrowWhenNamespaceBlank() {
try {
notificationRegistrationStatusService.updateNotificationRegistrationStatus(BLANK_TEXT, NOTIFICATION_NAME, new NotificationRegistrationStatusUpdateRequest(NotificationRegistrationStatusEntity.DISABLED));
fail();
} catch (Exception e) {
assertEquals(IllegalArgumentException.class, e.getClass());
assertEquals("The namespace must be specified", e.getMessage());
}
}
use of org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest in project herd by FINRAOS.
the class NotificationRegistrationStatusServiceTest method testUpdateNotificationRegistrationStatusAssertUpdateSuccessCaseInsensitive.
@Test
public void testUpdateNotificationRegistrationStatusAssertUpdateSuccessCaseInsensitive() {
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.toLowerCase()));
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 testUpdateNotificationRegistrationStatusAssertThrowNotificationNotFound.
@Test
public void testUpdateNotificationRegistrationStatusAssertThrowNotificationNotFound() {
try {
notificationRegistrationStatusService.updateNotificationRegistrationStatus(NAMESPACE, "DOES_NOT_EXIST", new NotificationRegistrationStatusUpdateRequest(NotificationRegistrationStatusEntity.DISABLED));
fail();
} catch (Exception e) {
assertEquals(ObjectNotFoundException.class, e.getClass());
assertEquals("The notification registration with namespace \"" + NAMESPACE + "\" and name \"DOES_NOT_EXIST\" was not found.", e.getMessage());
}
}
use of org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest in project herd by FINRAOS.
the class NotificationRegistrationStatusServiceTest method testUpdateNotificationRegistrationStatusAssertThrowWhenStatusBlank.
@Test
public void testUpdateNotificationRegistrationStatusAssertThrowWhenStatusBlank() {
try {
notificationRegistrationStatusService.updateNotificationRegistrationStatus(NAMESPACE, NOTIFICATION_NAME, new NotificationRegistrationStatusUpdateRequest(BLANK_TEXT));
fail();
} catch (Exception e) {
assertEquals(IllegalArgumentException.class, e.getClass());
assertEquals("The notification registration status must be specified", e.getMessage());
}
}
Aggregations