@Test public void testGetStorageUnitNotificationRegistrationsByNamespace() { StorageUnitNotificationRegistrationKeys storageUnitNotificationRegistrationKeys = new StorageUnitNotificationRegistrationKeys(notificationRegistrationDaoTestHelper.getExpectedNotificationRegistrationKeys()); when(storageUnitNotificationRegistrationService.getStorageUnitNotificationRegistrationsByNamespace(NAMESPACE)) .thenReturn(storageUnitNotificationRegistrationKeys); // Retrieve a list of business object data notification registration keys. StorageUnitNotificationRegistrationKeys resultStorageUnitNotificationRegistrationKeys = storageUnitNotificationRegistrationRestController.getStorageUnitNotificationRegistrationsByNamespace(NAMESPACE); // Verify the external calls. verify(storageUnitNotificationRegistrationService).getStorageUnitNotificationRegistrationsByNamespace(NAMESPACE); verifyNoMoreInteractions(storageUnitNotificationRegistrationService); // Validate the returned object. assertEquals(storageUnitNotificationRegistrationKeys, resultStorageUnitNotificationRegistrationKeys); }
@Test public void testGetStorageUnitNotificationRegistrationsByNamespaceLowerCaseParameters() { // Create and persist storage unit notification entities using upper case alternate key values. for (NotificationRegistrationKey notificationRegistrationKey : notificationRegistrationDaoTestHelper.getTestNotificationRegistrationKeys()) { NotificationRegistrationKey notificationRegistrationKeyUpperCase = new NotificationRegistrationKey(notificationRegistrationKey.getNamespace().toUpperCase(), notificationRegistrationKey.getNotificationName().toUpperCase()); notificationRegistrationDaoTestHelper.createStorageUnitNotificationRegistrationEntity(notificationRegistrationKeyUpperCase, 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 a list of storage unit notification registration keys using lower case namespace code value. StorageUnitNotificationRegistrationKeys resultKeys = storageUnitNotificationRegistrationService.getStorageUnitNotificationRegistrationsByNamespace(NAMESPACE.toLowerCase()); // Validate the returned object. List<NotificationRegistrationKey> expectedKeys = new ArrayList<>(); for (NotificationRegistrationKey origKey : notificationRegistrationDaoTestHelper.getExpectedNotificationRegistrationKeys()) { NotificationRegistrationKey expectedKey = new NotificationRegistrationKey(); expectedKeys.add(expectedKey); expectedKey.setNamespace(origKey.getNamespace().toUpperCase()); expectedKey.setNotificationName(origKey.getNotificationName().toUpperCase()); } assertEquals(expectedKeys, resultKeys.getStorageUnitNotificationRegistrationKeys()); }
@Test public void testGetBusinessObjectDataNotificationRegistrationsByNamespaceUpperCaseParameters() { // Create and persist business object data notification entities using lower case alternate key values. for (NotificationRegistrationKey notificationRegistrationKey : notificationRegistrationDaoTestHelper.getTestNotificationRegistrationKeys()) { NotificationRegistrationKey notificationRegistrationKeyLowerCase = new NotificationRegistrationKey(notificationRegistrationKey.getNamespace().toLowerCase(), notificationRegistrationKey.getNotificationName().toLowerCase()); notificationRegistrationDaoTestHelper.createBusinessObjectDataNotificationRegistrationEntity(notificationRegistrationKeyLowerCase, 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 upper case namespace code value. BusinessObjectDataNotificationRegistrationKeys resultKeys = businessObjectDataNotificationRegistrationService.getBusinessObjectDataNotificationRegistrationsByNamespace(NAMESPACE.toUpperCase()); // Validate the returned object. List<NotificationRegistrationKey> expectedKeys = new ArrayList<>(); for (NotificationRegistrationKey origKey : notificationRegistrationDaoTestHelper.getExpectedNotificationRegistrationKeys()) { NotificationRegistrationKey expectedKey = new NotificationRegistrationKey(); expectedKeys.add(expectedKey); expectedKey.setNamespace(origKey.getNamespace().toLowerCase()); expectedKey.setNotificationName(origKey.getNotificationName().toLowerCase()); } assertEquals(expectedKeys, resultKeys.getBusinessObjectDataNotificationRegistrationKeys()); }
@Test public void testGetStorageUnitNotificationRegistrationsByNamespaceUpperCaseParameters() { // Create and persist storage unit notification entities using lower case alternate key values. for (NotificationRegistrationKey notificationRegistrationKey : notificationRegistrationDaoTestHelper.getTestNotificationRegistrationKeys()) { NotificationRegistrationKey notificationRegistrationKeyLowerCase = new NotificationRegistrationKey(notificationRegistrationKey.getNamespace().toLowerCase(), notificationRegistrationKey.getNotificationName().toLowerCase()); notificationRegistrationDaoTestHelper.createStorageUnitNotificationRegistrationEntity(notificationRegistrationKeyLowerCase, 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 a list of storage unit notification registration keys using upper case namespace code value. StorageUnitNotificationRegistrationKeys resultKeys = storageUnitNotificationRegistrationService.getStorageUnitNotificationRegistrationsByNamespace(NAMESPACE.toUpperCase()); // Validate the returned object. List<NotificationRegistrationKey> expectedKeys = new ArrayList<>(); for (NotificationRegistrationKey origKey : notificationRegistrationDaoTestHelper.getExpectedNotificationRegistrationKeys()) { NotificationRegistrationKey expectedKey = new NotificationRegistrationKey(); expectedKeys.add(expectedKey); expectedKey.setNamespace(origKey.getNamespace().toLowerCase()); expectedKey.setNotificationName(origKey.getNotificationName().toLowerCase()); } assertEquals(expectedKeys, resultKeys.getStorageUnitNotificationRegistrationKeys()); }
@Test public void testGetBusinessObjectDataNotificationRegistrationsByNamespaceLowerCaseParameters() { // Create and persist business object data notification entities using upper case alternate key values. for (NotificationRegistrationKey notificationRegistrationKey : notificationRegistrationDaoTestHelper.getTestNotificationRegistrationKeys()) { NotificationRegistrationKey notificationRegistrationKeyUpperCase = new NotificationRegistrationKey(notificationRegistrationKey.getNamespace().toUpperCase(), notificationRegistrationKey.getNotificationName().toUpperCase()); notificationRegistrationDaoTestHelper.createBusinessObjectDataNotificationRegistrationEntity(notificationRegistrationKeyUpperCase, 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 lower case namespace code value. BusinessObjectDataNotificationRegistrationKeys resultKeys = businessObjectDataNotificationRegistrationService.getBusinessObjectDataNotificationRegistrationsByNamespace(NAMESPACE.toLowerCase()); // Validate the returned object. List<NotificationRegistrationKey> expectedKeys = new ArrayList<>(); for (NotificationRegistrationKey origKey : notificationRegistrationDaoTestHelper.getExpectedNotificationRegistrationKeys()) { NotificationRegistrationKey expectedKey = new NotificationRegistrationKey(); expectedKeys.add(expectedKey); expectedKey.setNamespace(origKey.getNamespace().toUpperCase()); expectedKey.setNotificationName(origKey.getNotificationName().toUpperCase()); } assertEquals(expectedKeys, resultKeys.getBusinessObjectDataNotificationRegistrationKeys()); }
@Test public void testGetStorageUnitNotificationRegistrationKeysByNamespace() { // Create and persist a set of storage unit notification registration entities. for (NotificationRegistrationKey storageUnitNotificationRegistrationKey : notificationRegistrationDaoTestHelper.getTestNotificationRegistrationKeys()) { notificationRegistrationDaoTestHelper .createStorageUnitNotificationRegistrationEntity(storageUnitNotificationRegistrationKey, NOTIFICATION_EVENT_TYPE, 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 a list of storage unit notification registration keys for the specified namespace. List<NotificationRegistrationKey> resultKeys = storageUnitNotificationRegistrationDao.getStorageUnitNotificationRegistrationKeysByNamespace(NAMESPACE); // Validate the returned object. assertEquals(notificationRegistrationDaoTestHelper.getExpectedNotificationRegistrationKeys(), resultKeys); }
@Test public void testGetBusinessObjectDataNotificationRegistrationKeysByNamespace() { // Create and persist a set of business object data notification registration entities. for (NotificationRegistrationKey businessObjectDataNotificationRegistrationKey : notificationRegistrationDaoTestHelper .getTestNotificationRegistrationKeys()) { notificationRegistrationDaoTestHelper .createBusinessObjectDataNotificationRegistrationEntity(businessObjectDataNotificationRegistrationKey, 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 for the specified namespace. List<NotificationRegistrationKey> resultKeys = businessObjectDataNotificationRegistrationDao.getBusinessObjectDataNotificationRegistrationKeysByNamespace(NAMESPACE); // Validate the returned object. assertEquals(notificationRegistrationDaoTestHelper.getExpectedNotificationRegistrationKeys(), resultKeys); }
@Test public void testGetStorageUnitNotificationRegistrationsByNamespace() { // Create and persist storage unit notification entities. for (NotificationRegistrationKey notificationRegistrationKey : notificationRegistrationDaoTestHelper.getTestNotificationRegistrationKeys()) { notificationRegistrationDaoTestHelper.createStorageUnitNotificationRegistrationEntity(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, null, STORAGE_NAME, null, null, notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED); } // Retrieve a list of storage unit notification registration keys. StorageUnitNotificationRegistrationKeys resultKeys = storageUnitNotificationRegistrationService.getStorageUnitNotificationRegistrationsByNamespace(NAMESPACE); // Validate the returned object. assertEquals(notificationRegistrationDaoTestHelper.getExpectedNotificationRegistrationKeys(), resultKeys.getStorageUnitNotificationRegistrationKeys()); }
@Test public void testGetBusinessObjectDataNotificationRegistrationsByNamespace() { // Create and persist business object data notification entities. for (NotificationRegistrationKey notificationRegistrationKey : notificationRegistrationDaoTestHelper.getTestNotificationRegistrationKeys()) { notificationRegistrationDaoTestHelper.createBusinessObjectDataNotificationRegistrationEntity(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, null, null, null, null, notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED); } // Retrieve a list of business object data notification registration keys. BusinessObjectDataNotificationRegistrationKeys resultKeys = businessObjectDataNotificationRegistrationService.getBusinessObjectDataNotificationRegistrationsByNamespace(NAMESPACE); // Validate the returned object. assertEquals(notificationRegistrationDaoTestHelper.getExpectedNotificationRegistrationKeys(), resultKeys.getBusinessObjectDataNotificationRegistrationKeys()); }
@Test public void testGetStorageUnitNotificationRegistrationsByNamespaceTrimParameters() { // Create and persist storage unit notification entities. for (NotificationRegistrationKey notificationRegistrationKey : notificationRegistrationDaoTestHelper.getTestNotificationRegistrationKeys()) { 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 a list of storage unit notification registration keys using input parameters with leading and trailing empty spaces. StorageUnitNotificationRegistrationKeys resultKeys = storageUnitNotificationRegistrationService.getStorageUnitNotificationRegistrationsByNamespace(addWhitespace(NAMESPACE)); // Validate the returned object. assertEquals(notificationRegistrationDaoTestHelper.getExpectedNotificationRegistrationKeys(), resultKeys.getStorageUnitNotificationRegistrationKeys()); }
@Test public void testGetBusinessObjectDataNotificationRegistrationsByNamespaceTrimParameters() { // Create and persist business object data notification entities. for (NotificationRegistrationKey notificationRegistrationKey : notificationRegistrationDaoTestHelper.getTestNotificationRegistrationKeys()) { 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. BusinessObjectDataNotificationRegistrationKeys resultKeys = businessObjectDataNotificationRegistrationService.getBusinessObjectDataNotificationRegistrationsByNamespace(addWhitespace(NAMESPACE)); // Validate the returned object. assertEquals(notificationRegistrationDaoTestHelper.getExpectedNotificationRegistrationKeys(), resultKeys.getBusinessObjectDataNotificationRegistrationKeys()); }