use of org.finra.herd.model.api.xml.BusinessObjectDataNotificationFilter in project herd by FINRAOS.
the class BusinessObjectDataNotificationRegistrationServiceTest method testGetBusinessObjectDataNotificationRegistrationsByNotificationFilterMissingRequiredParameters.
@Test
public void testGetBusinessObjectDataNotificationRegistrationsByNotificationFilterMissingRequiredParameters() {
// Try to get business object data notification registrations when business object definition namespace is not specified.
try {
businessObjectDataNotificationRegistrationService.getBusinessObjectDataNotificationRegistrationsByNotificationFilter(new BusinessObjectDataNotificationFilter(NO_BDEF_NAMESPACE, BDEF_NAME, NO_FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS));
fail("Should throw an IllegalArgumentException when business object definition namespace is not specified.");
} catch (IllegalArgumentException e) {
assertEquals("A business object definition namespace must be specified.", e.getMessage());
}
// Try to get business object data notification registrations when business object definition name is not specified.
try {
businessObjectDataNotificationRegistrationService.getBusinessObjectDataNotificationRegistrationsByNotificationFilter(new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, NO_BDEF_NAME, NO_FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS));
fail("Should throw an IllegalArgumentException when business object definition name is not specified.");
} catch (IllegalArgumentException e) {
assertEquals("A business object definition name must be specified.", e.getMessage());
}
}
use of org.finra.herd.model.api.xml.BusinessObjectDataNotificationFilter in project herd by FINRAOS.
the class BusinessObjectDataNotificationRegistrationServiceTest method testGetBusinessObjectDataNotificationRegistrationsByNotificationFilterTrimParameters.
@Test
public void testGetBusinessObjectDataNotificationRegistrationsByNotificationFilterTrimParameters() {
// Create a business object data notification registration key.
NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME);
// Create and persist a business object data notification registration entity.
notificationRegistrationDaoTestHelper.createBusinessObjectDataNotificationRegistrationEntity(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2, notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
// Retrieve a list of business object data notification registration keys using input parameters with leading and trailing empty spaces.
assertEquals(new BusinessObjectDataNotificationRegistrationKeys(Arrays.asList(notificationRegistrationKey)), businessObjectDataNotificationRegistrationService.getBusinessObjectDataNotificationRegistrationsByNotificationFilter(new BusinessObjectDataNotificationFilter(addWhitespace(BDEF_NAMESPACE), addWhitespace(BDEF_NAME), addWhitespace(FORMAT_USAGE_CODE), addWhitespace(FORMAT_FILE_TYPE_CODE), NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS)));
}
Aggregations