Search in sources :

Example 61 with NotificationRegistrationKey

use of org.finra.herd.model.api.xml.NotificationRegistrationKey in project herd by FINRAOS.

the class NotificationEventServiceTest method testProcessBusinessObjectDataRegistrationNotificationEventSyncAssertFireEnabledOnly.

@Test
public void testProcessBusinessObjectDataRegistrationNotificationEventSyncAssertFireEnabledOnly() throws Exception {
    // Create job definition
    JobDefinition jobDefinition = jobDefinitionServiceTestHelper.createJobDefinition(ACTIVITI_XML_LOG_VARIABLES_NO_REGEX_WITH_CLASSPATH);
    List<JobAction> jobActions1 = Arrays.asList(new JobAction(jobDefinition.getNamespace(), jobDefinition.getJobName(), CORRELATION_DATA));
    List<JobAction> jobActions2 = Arrays.asList(new JobAction(jobDefinition.getNamespace(), jobDefinition.getJobName(), CORRELATION_DATA_2));
    // Create a business object format with a schema.
    BusinessObjectFormatEntity businessObjectFormatEntity = businessObjectFormatDaoTestHelper.createBusinessObjectFormatEntity(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, FORMAT_DESCRIPTION, LATEST_VERSION_FLAG_SET, FIRST_PARTITION_COLUMN_NAME, NO_PARTITION_KEY_GROUP, NO_ATTRIBUTES, SCHEMA_DELIMITER_PIPE, SCHEMA_ESCAPE_CHARACTER_BACKSLASH, SCHEMA_NULL_VALUE_BACKSLASH_N, schemaColumnDaoTestHelper.getTestSchemaColumns(), schemaColumnDaoTestHelper.getTestPartitionColumns());
    // Create business object data with storage units.
    BusinessObjectDataEntity businessObjectDataEntity = businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(businessObjectFormatEntity, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION, true, BDATA_STATUS);
    StorageEntity storageEntity = storageDaoTestHelper.createStorageEntity(STORAGE_NAME, StoragePlatformEntity.S3);
    storageUnitDaoTestHelper.createStorageUnitEntity(storageEntity, businessObjectDataEntity, StorageUnitStatusEntity.ENABLED, NO_STORAGE_DIRECTORY_PATH);
    // Create and persist a business object data notification registration entity that is enabled.
    notificationRegistrationDaoTestHelper.createBusinessObjectDataNotificationRegistrationEntity(new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME), NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN.name(), BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, null, jobActions1, NotificationRegistrationStatusEntity.ENABLED);
    // Create and persist a business object data notification registration entity that is disabled.
    notificationRegistrationDaoTestHelper.createBusinessObjectDataNotificationRegistrationEntity(new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME_2), NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN.name(), BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME_2, BDATA_STATUS, null, jobActions2, NotificationRegistrationStatusEntity.DISABLED);
    // Trigger the notification
    List<Object> notificationActions = notificationEventService.processBusinessObjectDataNotificationEventSync(NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN, new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, null);
    assertEquals(1, notificationActions.size());
    assertEquals(Job.class, notificationActions.get(0).getClass());
    Job job = (Job) notificationActions.get(0);
    List<Parameter> parameters = job.getParameters();
    boolean found = false;
    for (Parameter parameter : parameters) {
        String name = parameter.getName();
        if ("notification_correlationData".equals(name)) {
            assertEquals(CORRELATION_DATA, parameter.getValue());
            found = true;
            break;
        }
    }
    assertTrue(found);
}
Also used : StorageEntity(org.finra.herd.model.jpa.StorageEntity) BusinessObjectFormatEntity(org.finra.herd.model.jpa.BusinessObjectFormatEntity) BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) JobAction(org.finra.herd.model.api.xml.JobAction) Parameter(org.finra.herd.model.api.xml.Parameter) BusinessObjectDataEntity(org.finra.herd.model.jpa.BusinessObjectDataEntity) Job(org.finra.herd.model.api.xml.Job) JobDefinition(org.finra.herd.model.api.xml.JobDefinition) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Example 62 with NotificationRegistrationKey

use of org.finra.herd.model.api.xml.NotificationRegistrationKey in project herd by FINRAOS.

the class NotificationEventServiceTest method runProcessStorageUnitStatusChangeNotificationEventSyncTest.

private void runProcessStorageUnitStatusChangeNotificationEventSyncTest() throws Exception {
    // Create a job definition.
    JobDefinition jobDefinition = jobDefinitionServiceTestHelper.createJobDefinition(ACTIVITI_XML_LOG_VARIABLES_NO_REGEX_WITH_CLASSPATH);
    // Create a job action.
    List<JobAction> jobActions = new ArrayList<>();
    jobActions.add(new JobAction(jobDefinition.getNamespace(), jobDefinition.getJobName(), CORRELATION_DATA));
    // Create a business object format with a schema.
    BusinessObjectFormatEntity businessObjectFormatEntity = businessObjectFormatDaoTestHelper.createBusinessObjectFormatEntity(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, FORMAT_DESCRIPTION, LATEST_VERSION_FLAG_SET, FIRST_PARTITION_COLUMN_NAME, NO_PARTITION_KEY_GROUP, NO_ATTRIBUTES, SCHEMA_DELIMITER_PIPE, SCHEMA_ESCAPE_CHARACTER_BACKSLASH, SCHEMA_NULL_VALUE_BACKSLASH_N, schemaColumnDaoTestHelper.getTestSchemaColumns(), schemaColumnDaoTestHelper.getTestPartitionColumns());
    // Create a business object data with a storage unit having a DISABLED status.
    BusinessObjectDataEntity businessObjectDataEntity = businessObjectDataDaoTestHelper.createBusinessObjectDataEntity(businessObjectFormatEntity, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION, LATEST_VERSION_FLAG_SET, BusinessObjectDataStatusEntity.VALID);
    StorageEntity storageEntity = storageDaoTestHelper.createStorageEntity(STORAGE_NAME, StoragePlatformEntity.S3);
    storageUnitDaoTestHelper.createStorageUnitEntity(storageEntity, businessObjectDataEntity, StorageUnitStatusEntity.DISABLED, NO_STORAGE_DIRECTORY_PATH);
    // Create and persist a storage unit notification registration entity.
    notificationRegistrationDaoTestHelper.createStorageUnitNotificationRegistrationEntity(new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME), NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, StorageUnitStatusEntity.ENABLED, StorageUnitStatusEntity.DISABLED, jobActions, NotificationRegistrationStatusEntity.ENABLED);
    // Trigger the notification.
    List<Object> notificationActions = notificationEventService.processStorageUnitNotificationEventSync(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG, new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), STORAGE_NAME, StorageUnitStatusEntity.ENABLED, StorageUnitStatusEntity.DISABLED);
    // Validate the result job.
    Job job = (Job) notificationActions.get(0);
    assertEquals(new Job(job.getId(), null, TEST_ACTIVITI_NAMESPACE_CD, TEST_ACTIVITI_JOB_NAME, null, null, null, null, Arrays.asList(new Parameter("notification_businessObjectDefinitionName", BDEF_NAME), new Parameter("notification_partitionValues", PARTITION_VALUE + "|" + StringUtils.join(SUBPARTITION_VALUES, "|")), new Parameter("notification_namespace", NAMESPACE), new Parameter("notification_businessObjectData", jsonHelper.objectToJson(businessObjectDataHelper.createBusinessObjectDataFromEntity(businessObjectDataEntity))), new Parameter("notification_businessObjectFormatUsage", FORMAT_USAGE_CODE), new Parameter(HERD_WORKFLOW_ENVIRONMENT, configurationHelper.getProperty(ConfigurationValue.HERD_ENVIRONMENT)), new Parameter("notification_businessObjectDefinitionNamespace", BDEF_NAMESPACE), new Parameter(ATTRIBUTE_NAME_1_MIXED_CASE, ATTRIBUTE_VALUE_1), new Parameter("notification_storageUnitEventType", NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name()), new Parameter("notification_oldStorageUnitStatus", StorageUnitStatusEntity.DISABLED), new Parameter("notification_businessObjectDataVersion", DATA_VERSION.toString()), new Parameter("notification_name", NOTIFICATION_NAME), new Parameter("notification_partitionColumnNames", "PRTN_CLMN001|PRTN_CLMN002|PRTN_CLMN003|PRTN_CLMN004|PRTN_CLMN005"), new Parameter("notification_businessObjectFormatVersion", FORMAT_VERSION.toString()), new Parameter("notification_businessObjectFormatFileType", FORMAT_FILE_TYPE_CODE), new Parameter("notification_storageName", STORAGE_NAME), new Parameter("notification_newStorageUnitStatus", StorageUnitStatusEntity.ENABLED), new Parameter("notification_correlationData", CORRELATION_DATA)), null, null, null), job);
}
Also used : ArrayList(java.util.ArrayList) StorageEntity(org.finra.herd.model.jpa.StorageEntity) BusinessObjectFormatEntity(org.finra.herd.model.jpa.BusinessObjectFormatEntity) BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) JobAction(org.finra.herd.model.api.xml.JobAction) Parameter(org.finra.herd.model.api.xml.Parameter) BusinessObjectDataEntity(org.finra.herd.model.jpa.BusinessObjectDataEntity) Job(org.finra.herd.model.api.xml.Job) JobDefinition(org.finra.herd.model.api.xml.JobDefinition) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey)

Example 63 with NotificationRegistrationKey

use of org.finra.herd.model.api.xml.NotificationRegistrationKey in project herd by FINRAOS.

the class BusinessObjectDataNotificationRegistrationDaoTest method testGetBusinessObjectDataNotificationRegistrations.

@Test
public void testGetBusinessObjectDataNotificationRegistrations() {
    // Create and persist a business object data notification registration entity with all optional parameters specified.
    BusinessObjectDataNotificationRegistrationEntity businessObjectDataNotificationRegistrationEntity = notificationRegistrationDaoTestHelper.createBusinessObjectDataNotificationRegistrationEntity(new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME), NOTIFICATION_EVENT_TYPE, BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, BDATA_STATUS, BDATA_STATUS_2, notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    // Create a business object data key.
    BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION);
    // Retrieve the business object notification registration matching the filter criteria.
    List<BusinessObjectDataNotificationRegistrationEntity> result = businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrations(NOTIFICATION_EVENT_TYPE, businessObjectDataKey, BDATA_STATUS, BDATA_STATUS_2, NotificationRegistrationStatusEntity.ENABLED);
    // Validate the returned object.
    assertEquals(Arrays.asList(businessObjectDataNotificationRegistrationEntity), result);
}
Also used : BusinessObjectDataNotificationRegistrationEntity(org.finra.herd.model.jpa.BusinessObjectDataNotificationRegistrationEntity) BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Example 64 with NotificationRegistrationKey

use of org.finra.herd.model.api.xml.NotificationRegistrationKey in project herd by FINRAOS.

the class BusinessObjectDataNotificationRegistrationDaoTest method testGetBusinessObjectDataNotificationRegistrationKeysByNotificationFilter.

@Test
public void testGetBusinessObjectDataNotificationRegistrationKeysByNotificationFilter() {
    // 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, NOTIFICATION_EVENT_TYPE, 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.
    assertEquals(Arrays.asList(notificationRegistrationKey), businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrationKeysByNotificationFilter(new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS)));
    // Retrieve a list of business object data notification registration keys by not specifying optional parameters.
    assertEquals(Arrays.asList(notificationRegistrationKey), businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrationKeysByNotificationFilter(new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, NO_FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS)));
    assertEquals(Arrays.asList(notificationRegistrationKey), businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrationKeysByNotificationFilter(new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, NO_FORMAT_FILE_TYPE_CODE, NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS)));
    // Get business object data notification registration keys by passing all case-insensitive parameters in uppercase.
    assertEquals(Arrays.asList(notificationRegistrationKey), businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrationKeysByNotificationFilter(new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS)));
    // Get business object data notification registration keys by passing all case-insensitive parameters in lowercase.
    assertEquals(Arrays.asList(notificationRegistrationKey), businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrationKeysByNotificationFilter(new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE.toLowerCase(), BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS)));
    // Try invalid values for all input parameters.
    assertTrue(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrationKeysByNotificationFilter(new BusinessObjectDataNotificationFilter("I_DO_NO_EXIST", BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS)).isEmpty());
    assertTrue(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrationKeysByNotificationFilter(new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, "I_DO_NO_EXIST", FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS)).isEmpty());
    assertTrue(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrationKeysByNotificationFilter(new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, "I_DO_NO_EXIST", FORMAT_FILE_TYPE_CODE, NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS)).isEmpty());
    assertTrue(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrationKeysByNotificationFilter(new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, "I_DO_NO_EXIST", NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_BDATA_STATUS, NO_BDATA_STATUS)).isEmpty());
}
Also used : BusinessObjectDataNotificationFilter(org.finra.herd.model.api.xml.BusinessObjectDataNotificationFilter) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Example 65 with NotificationRegistrationKey

use of org.finra.herd.model.api.xml.NotificationRegistrationKey in project herd by FINRAOS.

the class BusinessObjectDataNotificationRegistrationDaoTest method testGetBusinessObjectDataNotificationRegistrationsInvalidInputs.

@Test
public void testGetBusinessObjectDataNotificationRegistrationsInvalidInputs() {
    // Create and persist a business object data notification registration entity with all optional parameters specified.
    BusinessObjectDataNotificationRegistrationEntity businessObjectDataNotificationRegistrationEntity = notificationRegistrationDaoTestHelper.createBusinessObjectDataNotificationRegistrationEntity(new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME), NOTIFICATION_EVENT_TYPE, 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 the business object notification with all input parameters matching the filter criteria.
    List<BusinessObjectDataNotificationRegistrationEntity> result = businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrations(NOTIFICATION_EVENT_TYPE, new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, BDATA_STATUS_2, NotificationRegistrationStatusEntity.ENABLED);
    // Validate the returned object.
    assertEquals(Arrays.asList(businessObjectDataNotificationRegistrationEntity), result);
    // Try to retrieve the business object data notification registration when using invalid business object definition namespace.
    assertTrue(CollectionUtils.isEmpty(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrations(NOTIFICATION_EVENT_TYPE, new BusinessObjectDataKey("I_DO_NOT_EXIST", BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, BDATA_STATUS_2, NotificationRegistrationStatusEntity.ENABLED)));
    // Try to retrieve the business object data notification registration when using invalid business object definition name.
    assertTrue(CollectionUtils.isEmpty(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrations(NOTIFICATION_EVENT_TYPE, new BusinessObjectDataKey(BDEF_NAMESPACE, "I_DO_NOT_EXIST", FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, BDATA_STATUS_2, NotificationRegistrationStatusEntity.ENABLED)));
    // Try to retrieve the business object data notification registration when using invalid business object format usage.
    assertTrue(CollectionUtils.isEmpty(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrations(NOTIFICATION_EVENT_TYPE, new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, "I_DO_NOT_EXIST", FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, BDATA_STATUS_2, NotificationRegistrationStatusEntity.ENABLED)));
    // Try to retrieve the business object data notification registration when using invalid format file type.
    assertTrue(CollectionUtils.isEmpty(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrations(NOTIFICATION_EVENT_TYPE, new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, "I_DO_NOT_EXIST", FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, BDATA_STATUS_2, NotificationRegistrationStatusEntity.ENABLED)));
    // Try to retrieve the business object data notification registration when using invalid business object format version.
    assertTrue(CollectionUtils.isEmpty(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrations(NOTIFICATION_EVENT_TYPE, new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, INVALID_FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, BDATA_STATUS_2, NotificationRegistrationStatusEntity.ENABLED)));
    // Try to retrieve the business object data notification registration when using invalid new business object data status.
    assertTrue(CollectionUtils.isEmpty(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrations(NOTIFICATION_EVENT_TYPE, new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), "I_DO_NOT_EXIST", BDATA_STATUS_2, NotificationRegistrationStatusEntity.ENABLED)));
    // Try to retrieve the business object data notification registration when using invalid old business object data status.
    assertTrue(CollectionUtils.isEmpty(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrations(NOTIFICATION_EVENT_TYPE, new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, "I_DO_NOT_EXIST", NotificationRegistrationStatusEntity.ENABLED)));
    // Try to retrieve the business object data notification registration when using invalid notification registration status.
    assertTrue(CollectionUtils.isEmpty(businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrations(NOTIFICATION_EVENT_TYPE, new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION), BDATA_STATUS, BDATA_STATUS_2, NotificationRegistrationStatusEntity.DISABLED)));
}
Also used : BusinessObjectDataNotificationRegistrationEntity(org.finra.herd.model.jpa.BusinessObjectDataNotificationRegistrationEntity) BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Aggregations

NotificationRegistrationKey (org.finra.herd.model.api.xml.NotificationRegistrationKey)141 Test (org.junit.Test)129 JobAction (org.finra.herd.model.api.xml.JobAction)49 BusinessObjectDataNotificationFilter (org.finra.herd.model.api.xml.BusinessObjectDataNotificationFilter)46 StorageUnitNotificationFilter (org.finra.herd.model.api.xml.StorageUnitNotificationFilter)44 BusinessObjectDataNotificationRegistration (org.finra.herd.model.api.xml.BusinessObjectDataNotificationRegistration)27 StorageUnitNotificationRegistration (org.finra.herd.model.api.xml.StorageUnitNotificationRegistration)26 BusinessObjectDataNotificationRegistrationEntity (org.finra.herd.model.jpa.BusinessObjectDataNotificationRegistrationEntity)17 ArrayList (java.util.ArrayList)16 BusinessObjectDataKey (org.finra.herd.model.api.xml.BusinessObjectDataKey)15 BusinessObjectDataNotificationRegistrationCreateRequest (org.finra.herd.model.api.xml.BusinessObjectDataNotificationRegistrationCreateRequest)14 StorageUnitNotificationRegistrationEntity (org.finra.herd.model.jpa.StorageUnitNotificationRegistrationEntity)14 BusinessObjectDataNotificationRegistrationKeys (org.finra.herd.model.api.xml.BusinessObjectDataNotificationRegistrationKeys)13 StorageUnitNotificationRegistrationKeys (org.finra.herd.model.api.xml.StorageUnitNotificationRegistrationKeys)13 ObjectNotFoundException (org.finra.herd.model.ObjectNotFoundException)11 BusinessObjectDataNotificationRegistrationUpdateRequest (org.finra.herd.model.api.xml.BusinessObjectDataNotificationRegistrationUpdateRequest)11 StorageUnitNotificationRegistrationCreateRequest (org.finra.herd.model.api.xml.StorageUnitNotificationRegistrationCreateRequest)11 StorageUnitNotificationRegistrationUpdateRequest (org.finra.herd.model.api.xml.StorageUnitNotificationRegistrationUpdateRequest)11 StorageEntity (org.finra.herd.model.jpa.StorageEntity)10 JobDefinition (org.finra.herd.model.api.xml.JobDefinition)9