Search in sources :

Example 6 with NotificationRegistrationStatusUpdateRequest

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);
}
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 7 with NotificationRegistrationStatusUpdateRequest

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);
}
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 8 with NotificationRegistrationStatusUpdateRequest

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

Example 9 with NotificationRegistrationStatusUpdateRequest

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

Example 10 with NotificationRegistrationStatusUpdateRequest

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());
    }
}
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