Search in sources :

Example 16 with StorageUnitNotificationRegistration

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

the class StorageUnitNotificationRegistrationServiceTest method testUpdateStorageUnitNotificationRegistrationLowerCaseParameters.

@Test
public void testUpdateStorageUnitNotificationRegistrationLowerCaseParameters() {
    // Create database entities required for testing using upper case alternate key values.
    notificationRegistrationServiceTestHelper.createDatabaseEntitiesForStorageUnitNotificationRegistrationTesting(NAMESPACE.toUpperCase(), Arrays.asList(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name().toUpperCase(), NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name().toUpperCase()), BDEF_NAMESPACE_2.toUpperCase(), BDEF_NAME_2.toUpperCase(), Arrays.asList(FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE_2.toUpperCase()), Arrays.asList(STORAGE_NAME.toUpperCase(), STORAGE_NAME_2.toUpperCase()), Arrays.asList(STORAGE_UNIT_STATUS.toUpperCase(), STORAGE_UNIT_STATUS_2.toUpperCase(), STORAGE_UNIT_STATUS_3.toUpperCase(), STORAGE_UNIT_STATUS_4.toUpperCase()), Arrays.asList(new JobAction(JOB_NAMESPACE_2.toUpperCase(), JOB_NAME_2.toUpperCase(), null)));
    // Create and persist a storage unit notification registration entity using upper case alternate key values.
    NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE.toUpperCase(), NOTIFICATION_NAME.toUpperCase());
    notificationRegistrationDaoTestHelper.createStorageUnitNotificationRegistrationEntity(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name().toUpperCase(), BDEF_NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_VERSION, STORAGE_NAME.toUpperCase(), STORAGE_UNIT_STATUS.toUpperCase(), STORAGE_UNIT_STATUS_2.toUpperCase(), Arrays.asList(new JobAction(JOB_NAMESPACE.toUpperCase(), JOB_NAME.toUpperCase(), CORRELATION_DATA)), NotificationRegistrationStatusEntity.ENABLED);
    // Update the storage unit notification using lower case input parameters.
    StorageUnitNotificationRegistration resultStorageUnitNotificationRegistration = storageUnitNotificationRegistrationService.updateStorageUnitNotificationRegistration(new NotificationRegistrationKey(NAMESPACE.toLowerCase(), NOTIFICATION_NAME.toLowerCase()), new StorageUnitNotificationRegistrationUpdateRequest(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name().toLowerCase(), new StorageUnitNotificationFilter(BDEF_NAMESPACE_2.toLowerCase(), BDEF_NAME_2.toLowerCase(), FORMAT_USAGE_CODE_2.toLowerCase(), FORMAT_FILE_TYPE_CODE_2.toLowerCase(), FORMAT_VERSION_2, STORAGE_NAME_2.toLowerCase(), STORAGE_UNIT_STATUS_3.toLowerCase(), NO_STORAGE_UNIT_STATUS), Arrays.asList(new JobAction(JOB_NAMESPACE_2.toLowerCase(), JOB_NAME_2.toLowerCase(), CORRELATION_DATA_2.toLowerCase())), "enabled"));
    // Validate the returned object.
    assertEquals(new StorageUnitNotificationRegistration(resultStorageUnitNotificationRegistration.getId(), notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name().toUpperCase(), new StorageUnitNotificationFilter(BDEF_NAMESPACE_2.toUpperCase(), BDEF_NAME_2.toUpperCase(), FORMAT_USAGE_CODE_2.toLowerCase(), FORMAT_FILE_TYPE_CODE_2.toUpperCase(), FORMAT_VERSION_2, STORAGE_NAME_2.toUpperCase(), STORAGE_UNIT_STATUS_3.toUpperCase(), NO_STORAGE_UNIT_STATUS), Arrays.asList(new JobAction(JOB_NAMESPACE_2.toUpperCase(), JOB_NAME_2.toUpperCase(), CORRELATION_DATA_2.toLowerCase())), NotificationRegistrationStatusEntity.ENABLED), resultStorageUnitNotificationRegistration);
}
Also used : JobAction(org.finra.herd.model.api.xml.JobAction) StorageUnitNotificationRegistrationUpdateRequest(org.finra.herd.model.api.xml.StorageUnitNotificationRegistrationUpdateRequest) StorageUnitNotificationRegistration(org.finra.herd.model.api.xml.StorageUnitNotificationRegistration) StorageUnitNotificationFilter(org.finra.herd.model.api.xml.StorageUnitNotificationFilter) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Example 17 with StorageUnitNotificationRegistration

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

the class StorageUnitNotificationRegistrationServiceTest method testGetStorageUnitNotificationRegistration.

@Test
public void testGetStorageUnitNotificationRegistration() {
    NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME);
    // Create and persist a storage unit notification registration entity.
    notificationRegistrationDaoTestHelper.createStorageUnitNotificationRegistrationEntity(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, STORAGE_UNIT_STATUS, STORAGE_UNIT_STATUS_2, notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    // Retrieve the storage unit notification registration.
    StorageUnitNotificationRegistration resultStorageUnitNotificationRegistration = storageUnitNotificationRegistrationService.getStorageUnitNotificationRegistration(notificationRegistrationKey);
    // Validate the returned object.
    assertEquals(new StorageUnitNotificationRegistration(resultStorageUnitNotificationRegistration.getId(), notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), new StorageUnitNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, STORAGE_UNIT_STATUS, STORAGE_UNIT_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED), resultStorageUnitNotificationRegistration);
}
Also used : StorageUnitNotificationRegistration(org.finra.herd.model.api.xml.StorageUnitNotificationRegistration) StorageUnitNotificationFilter(org.finra.herd.model.api.xml.StorageUnitNotificationFilter) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Example 18 with StorageUnitNotificationRegistration

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

the class StorageUnitNotificationRegistrationServiceTest method testUpdateStorageUnitNotificationRegistrationUpperCaseParameters.

@Test
public void testUpdateStorageUnitNotificationRegistrationUpperCaseParameters() {
    // Create database entities required for testing using lower case alternate key values.
    notificationRegistrationServiceTestHelper.createDatabaseEntitiesForStorageUnitNotificationRegistrationTesting(NAMESPACE.toLowerCase(), Arrays.asList(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name().toLowerCase(), NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name().toLowerCase()), BDEF_NAMESPACE_2.toLowerCase(), BDEF_NAME_2.toLowerCase(), Arrays.asList(FORMAT_FILE_TYPE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE_2.toLowerCase()), Arrays.asList(STORAGE_NAME.toLowerCase(), STORAGE_NAME_2.toLowerCase()), Arrays.asList(STORAGE_UNIT_STATUS.toLowerCase(), STORAGE_UNIT_STATUS_2.toLowerCase(), STORAGE_UNIT_STATUS_3.toLowerCase(), STORAGE_UNIT_STATUS_4.toLowerCase()), Arrays.asList(new JobAction(JOB_NAMESPACE_2.toLowerCase(), JOB_NAME_2.toLowerCase(), null)));
    // Create and persist a storage unit notification registration entity using lower case alternate key values.
    NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE.toLowerCase(), NOTIFICATION_NAME.toLowerCase());
    notificationRegistrationDaoTestHelper.createStorageUnitNotificationRegistrationEntity(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name().toLowerCase(), BDEF_NAMESPACE.toLowerCase(), BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), FORMAT_VERSION, STORAGE_NAME.toLowerCase(), STORAGE_UNIT_STATUS.toLowerCase(), STORAGE_UNIT_STATUS_2.toLowerCase(), Arrays.asList(new JobAction(JOB_NAMESPACE.toLowerCase(), JOB_NAME.toLowerCase(), CORRELATION_DATA)), NotificationRegistrationStatusEntity.ENABLED);
    // Update the storage unit notification using upper case input parameters.
    StorageUnitNotificationRegistration resultStorageUnitNotificationRegistration = storageUnitNotificationRegistrationService.updateStorageUnitNotificationRegistration(new NotificationRegistrationKey(NAMESPACE.toUpperCase(), NOTIFICATION_NAME.toUpperCase()), new StorageUnitNotificationRegistrationUpdateRequest(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name().toUpperCase(), new StorageUnitNotificationFilter(BDEF_NAMESPACE_2.toUpperCase(), BDEF_NAME_2.toUpperCase(), FORMAT_USAGE_CODE_2.toUpperCase(), FORMAT_FILE_TYPE_CODE_2.toUpperCase(), FORMAT_VERSION_2, STORAGE_NAME_2.toUpperCase(), STORAGE_UNIT_STATUS_3.toUpperCase(), NO_STORAGE_UNIT_STATUS), Arrays.asList(new JobAction(JOB_NAMESPACE_2.toUpperCase(), JOB_NAME_2.toUpperCase(), CORRELATION_DATA_2.toUpperCase())), NotificationRegistrationStatusEntity.ENABLED));
    // Validate the returned object.
    assertEquals(new StorageUnitNotificationRegistration(resultStorageUnitNotificationRegistration.getId(), new NotificationRegistrationKey(NAMESPACE.toLowerCase(), NOTIFICATION_NAME.toLowerCase()), NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name().toLowerCase(), new StorageUnitNotificationFilter(BDEF_NAMESPACE_2.toLowerCase(), BDEF_NAME_2.toLowerCase(), FORMAT_USAGE_CODE_2.toUpperCase(), FORMAT_FILE_TYPE_CODE_2.toLowerCase(), FORMAT_VERSION_2, STORAGE_NAME_2.toLowerCase(), STORAGE_UNIT_STATUS_3.toLowerCase(), NO_STORAGE_UNIT_STATUS), Arrays.asList(new JobAction(JOB_NAMESPACE_2.toLowerCase(), JOB_NAME_2.toLowerCase(), CORRELATION_DATA_2.toUpperCase())), NotificationRegistrationStatusEntity.ENABLED), resultStorageUnitNotificationRegistration);
}
Also used : JobAction(org.finra.herd.model.api.xml.JobAction) StorageUnitNotificationRegistrationUpdateRequest(org.finra.herd.model.api.xml.StorageUnitNotificationRegistrationUpdateRequest) StorageUnitNotificationRegistration(org.finra.herd.model.api.xml.StorageUnitNotificationRegistration) StorageUnitNotificationFilter(org.finra.herd.model.api.xml.StorageUnitNotificationFilter) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Example 19 with StorageUnitNotificationRegistration

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

the class StorageUnitNotificationRegistrationServiceTest method testGetStorageUnitNotificationRegistrationLowerCaseParameters.

@Test
public void testGetStorageUnitNotificationRegistrationLowerCaseParameters() {
    // Create and persist a storage unit notification registration entity using upper case alternate key values.
    NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE.toUpperCase(), NOTIFICATION_NAME.toUpperCase());
    StorageUnitNotificationRegistrationEntity storageUnitNotificationRegistrationEntity = notificationRegistrationDaoTestHelper.createStorageUnitNotificationRegistrationEntity(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, STORAGE_UNIT_STATUS, STORAGE_UNIT_STATUS_2, notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    // Retrieve the storage unit notification using lower case input parameters.
    StorageUnitNotificationRegistration resultStorageUnitNotificationRegistration = storageUnitNotificationRegistrationService.getStorageUnitNotificationRegistration(new NotificationRegistrationKey(NAMESPACE.toLowerCase(), NOTIFICATION_NAME.toLowerCase()));
    // Validate the returned object.
    assertEquals(new StorageUnitNotificationRegistration(storageUnitNotificationRegistrationEntity.getId(), notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), new StorageUnitNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, STORAGE_UNIT_STATUS, STORAGE_UNIT_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED), resultStorageUnitNotificationRegistration);
}
Also used : StorageUnitNotificationRegistration(org.finra.herd.model.api.xml.StorageUnitNotificationRegistration) StorageUnitNotificationRegistrationEntity(org.finra.herd.model.jpa.StorageUnitNotificationRegistrationEntity) StorageUnitNotificationFilter(org.finra.herd.model.api.xml.StorageUnitNotificationFilter) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Example 20 with StorageUnitNotificationRegistration

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

the class StorageUnitNotificationRegistrationServiceTest method testDeleteStorageUnitNotificationRegistrationUpperCaseParameters.

@Test
public void testDeleteStorageUnitNotificationRegistrationUpperCaseParameters() {
    // Create and persist a storage unit notification registration entity using lower case alternate key values.
    NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE.toLowerCase(), NOTIFICATION_NAME.toLowerCase());
    StorageUnitNotificationRegistrationEntity storageUnitNotificationRegistrationEntity = notificationRegistrationDaoTestHelper.createStorageUnitNotificationRegistrationEntity(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, STORAGE_UNIT_STATUS, STORAGE_UNIT_STATUS_2, notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED);
    // Validate that this storage unit notification exists.
    assertNotNull(storageUnitNotificationRegistrationDao.getStorageUnitNotificationRegistrationByAltKey(notificationRegistrationKey));
    // Delete this storage unit notification using upper case input parameters.
    StorageUnitNotificationRegistration deletedStorageUnitNotificationRegistration = storageUnitNotificationRegistrationService.deleteStorageUnitNotificationRegistration(new NotificationRegistrationKey(NAMESPACE.toUpperCase(), NOTIFICATION_NAME.toUpperCase()));
    // Validate the returned object.
    assertEquals(new StorageUnitNotificationRegistration(storageUnitNotificationRegistrationEntity.getId(), notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), new StorageUnitNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, STORAGE_NAME, STORAGE_UNIT_STATUS, STORAGE_UNIT_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED), deletedStorageUnitNotificationRegistration);
    // Ensure that this storage unit notification is no longer there.
    assertNull(storageUnitNotificationRegistrationDao.getStorageUnitNotificationRegistrationByAltKey(notificationRegistrationKey));
}
Also used : StorageUnitNotificationRegistration(org.finra.herd.model.api.xml.StorageUnitNotificationRegistration) StorageUnitNotificationRegistrationEntity(org.finra.herd.model.jpa.StorageUnitNotificationRegistrationEntity) StorageUnitNotificationFilter(org.finra.herd.model.api.xml.StorageUnitNotificationFilter) NotificationRegistrationKey(org.finra.herd.model.api.xml.NotificationRegistrationKey) Test(org.junit.Test)

Aggregations

NotificationRegistrationKey (org.finra.herd.model.api.xml.NotificationRegistrationKey)26 StorageUnitNotificationFilter (org.finra.herd.model.api.xml.StorageUnitNotificationFilter)26 StorageUnitNotificationRegistration (org.finra.herd.model.api.xml.StorageUnitNotificationRegistration)26 Test (org.junit.Test)25 JobAction (org.finra.herd.model.api.xml.JobAction)11 StorageUnitNotificationRegistrationUpdateRequest (org.finra.herd.model.api.xml.StorageUnitNotificationRegistrationUpdateRequest)8 StorageUnitNotificationRegistrationCreateRequest (org.finra.herd.model.api.xml.StorageUnitNotificationRegistrationCreateRequest)7 StorageUnitNotificationRegistrationEntity (org.finra.herd.model.jpa.StorageUnitNotificationRegistrationEntity)7 ArrayList (java.util.ArrayList)1 NotificationActionEntity (org.finra.herd.model.jpa.NotificationActionEntity)1 NotificationJobActionEntity (org.finra.herd.model.jpa.NotificationJobActionEntity)1