Search in sources :

Example 1 with NotificationRegistrationStatusUpdateRequest

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);
}
Also used : NotificationRegistrationStatusUpdateRequest(org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest) NotificationRegistrationStatusUpdateResponse(org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateResponse) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Example 2 with NotificationRegistrationStatusUpdateRequest

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());
    }
}
Also used : NotificationRegistrationStatusUpdateRequest(org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest) ObjectNotFoundException(org.finra.herd.model.ObjectNotFoundException) Test(org.junit.Test)

Example 3 with NotificationRegistrationStatusUpdateRequest

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);
}
Also used : NotificationRegistrationStatusUpdateRequest(org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest) NotificationRegistrationStatusUpdateResponse(org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateResponse) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Example 4 with NotificationRegistrationStatusUpdateRequest

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());
    }
}
Also used : ObjectNotFoundException(org.finra.herd.model.ObjectNotFoundException) NotificationRegistrationStatusUpdateRequest(org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest) ObjectNotFoundException(org.finra.herd.model.ObjectNotFoundException) Test(org.junit.Test)

Example 5 with NotificationRegistrationStatusUpdateRequest

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());
    }
}
Also used : NotificationRegistrationStatusUpdateRequest(org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest) ObjectNotFoundException(org.finra.herd.model.ObjectNotFoundException) Test(org.junit.Test)

Aggregations

NotificationRegistrationStatusUpdateRequest (org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateRequest)11 Test (org.junit.Test)11 ObjectNotFoundException (org.finra.herd.model.ObjectNotFoundException)7 NotificationRegistrationKey (org.finra.herd.model.api.xml.NotificationRegistrationKey)4 NotificationRegistrationStatusUpdateResponse (org.finra.herd.model.api.xml.NotificationRegistrationStatusUpdateResponse)4