@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 testGetStorageUnitNotificationRegistrationsByNotificationFilterLowerCaseParameters() { // Create a storage unit notification registration key. 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 a list of storage unit notification registration keys using lower case input parameters. assertEquals(new StorageUnitNotificationRegistrationKeys(Arrays.asList(notificationRegistrationKey)), storageUnitNotificationRegistrationService .getStorageUnitNotificationRegistrationsByNotificationFilter( new StorageUnitNotificationFilter(BDEF_NAMESPACE.toLowerCase(), BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), NO_FORMAT_VERSION, NO_STORAGE_NAME, NO_STORAGE_UNIT_STATUS, NO_STORAGE_UNIT_STATUS))); }
@Test public void testUpdateStorageUnitNotificationRegistration() { NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME); // Create database entities required for testing. notificationRegistrationServiceTestHelper.createDatabaseEntitiesForStorageUnitNotificationRegistrationTesting(NAMESPACE, Arrays .asList(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name()), BDEF_NAMESPACE_2, BDEF_NAME_2, Arrays.asList(FORMAT_FILE_TYPE_CODE, FORMAT_FILE_TYPE_CODE_2), Arrays.asList(STORAGE_NAME, STORAGE_NAME_2), Arrays.asList(STORAGE_UNIT_STATUS, STORAGE_UNIT_STATUS_2, STORAGE_UNIT_STATUS_3, STORAGE_UNIT_STATUS_4), notificationRegistrationDaoTestHelper.getTestJobActions2()); // 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); // Update the storage unit notification registration. StorageUnitNotificationRegistration resultStorageUnitNotificationRegistration = storageUnitNotificationRegistrationService .updateStorageUnitNotificationRegistration(new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME), new StorageUnitNotificationRegistrationUpdateRequest(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), new StorageUnitNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, STORAGE_UNIT_STATUS_3, NO_STORAGE_UNIT_STATUS), notificationRegistrationDaoTestHelper.getTestJobActions2(), NotificationRegistrationStatusEntity.DISABLED)); // Validate the returned object. assertEquals(new StorageUnitNotificationRegistration(resultStorageUnitNotificationRegistration.getId(), notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), new StorageUnitNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, STORAGE_UNIT_STATUS_3, NO_STORAGE_UNIT_STATUS), notificationRegistrationDaoTestHelper.getTestJobActions2(), NotificationRegistrationStatusEntity.DISABLED), resultStorageUnitNotificationRegistration); }
@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 testGetBusinessObjectDataNotificationRegistrationsByNotificationFilterUpperCaseParameters() { // 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 upper case input parameters. assertEquals(new BusinessObjectDataNotificationRegistrationKeys(Arrays.asList(notificationRegistrationKey)), businessObjectDataNotificationRegistrationService.getBusinessObjectDataNotificationRegistrationsByNotificationFilter( 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))); }
@Test public void testUpdateBusinessObjectDataNotificationRegistrationWithDisabledStatus() { NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME); // Create database entities required for testing. notificationRegistrationServiceTestHelper.createDatabaseEntitiesForBusinessObjectDataNotificationRegistrationTesting(NAMESPACE, Arrays .asList(NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN.name()), BDEF_NAMESPACE_2, BDEF_NAME_2, Arrays.asList(FORMAT_FILE_TYPE_CODE, FORMAT_FILE_TYPE_CODE_2), Arrays.asList(STORAGE_NAME, STORAGE_NAME_2), Arrays.asList(BDATA_STATUS, BDATA_STATUS_2, BDATA_STATUS_3, BDATA_STATUS_4), notificationRegistrationDaoTestHelper.getTestJobActions2()); // 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); // Update the business object data notification registration. BusinessObjectDataNotificationRegistration resultBusinessObjectDataNotificationRegistration = businessObjectDataNotificationRegistrationService .updateBusinessObjectDataNotificationRegistration(new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME), new BusinessObjectDataNotificationRegistrationUpdateRequest(NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, BDATA_STATUS_3, NO_BDATA_STATUS), notificationRegistrationDaoTestHelper.getTestJobActions2(), NotificationRegistrationStatusEntity.DISABLED)); // Validate the returned object. assertEquals(new BusinessObjectDataNotificationRegistration(resultBusinessObjectDataNotificationRegistration.getId(), notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, BDATA_STATUS_3, NO_BDATA_STATUS), notificationRegistrationDaoTestHelper.getTestJobActions2(), NotificationRegistrationStatusEntity.DISABLED), resultBusinessObjectDataNotificationRegistration); }
/** * Create and persist database entities required for testing. */ public void createDatabaseEntitiesForStorageUnitNotificationRegistrationTesting() { createDatabaseEntitiesForStorageUnitNotificationRegistrationTesting(AbstractServiceTest.NAMESPACE, Arrays.asList(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), AbstractServiceTest.NOTIFICATION_EVENT_TYPE), AbstractServiceTest.BDEF_NAMESPACE, AbstractServiceTest.BDEF_NAME, Arrays.asList(AbstractServiceTest.FORMAT_FILE_TYPE_CODE), Arrays.asList(AbstractServiceTest.STORAGE_NAME), Arrays.asList(AbstractServiceTest.STORAGE_UNIT_STATUS, AbstractServiceTest.STORAGE_UNIT_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions()); }
new StorageUnitNotificationRegistrationUpdateRequest(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), new StorageUnitNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, STORAGE_UNIT_STATUS, STORAGE_UNIT_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions2(), NotificationRegistrationStatusEntity.ENABLED)); fail("Should throw an IllegalArgumentException when namespace is not specified."); new StorageUnitNotificationRegistrationUpdateRequest(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), new StorageUnitNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, STORAGE_UNIT_STATUS, STORAGE_UNIT_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions2(), NotificationRegistrationStatusEntity.ENABLED)); fail("Should throw an IllegalArgumentException when notification name is not specified."); new StorageUnitNotificationRegistrationUpdateRequest(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), new StorageUnitNotificationFilter(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, BLANK_TEXT, STORAGE_UNIT_STATUS, STORAGE_UNIT_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions(), NotificationRegistrationStatusEntity.ENABLED)); fail("Should throw an IllegalArgumentException when storage name is not specified."); new StorageUnitNotificationRegistrationUpdateRequest(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), new StorageUnitNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, STORAGE_UNIT_STATUS, STORAGE_UNIT_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions2(), BLANK_TEXT)); fail("Should throw an IllegalArgumentException when notification registration status is not specified.");
notificationRegistrationDaoTestHelper.createBusinessObjectDataNotificationRegistrationEntity(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name().toUpperCase(), BDEF_NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_VERSION, STORAGE_NAME.toUpperCase(), BDATA_STATUS.toUpperCase(),
if (notificationEventTypeEntity == null) notificationEventTypeEntity = createNotificationEventTypeEntity(notificationEventTypeCode); if (notificationRegistrationStatusEntity == null) notificationRegistrationStatusEntity = createNotificationRegistrationStatusEntity(notificationRegistrationStatus);
@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 testUpdateStorageUnitNotificationRegistration() { NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME); StorageUnitNotificationRegistration storageUnitNotificationRegistration = new StorageUnitNotificationRegistration(ID, notificationRegistrationKey, NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), new StorageUnitNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, STORAGE_UNIT_STATUS_3, STORAGE_UNIT_STATUS_4), notificationRegistrationDaoTestHelper.getTestJobActions2(), NotificationRegistrationStatusEntity.DISABLED); StorageUnitNotificationRegistrationUpdateRequest request = new StorageUnitNotificationRegistrationUpdateRequest(NotificationEventTypeEntity.EventTypesStorageUnit.STRGE_UNIT_STTS_CHG.name(), new StorageUnitNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, STORAGE_UNIT_STATUS_3, STORAGE_UNIT_STATUS_4), notificationRegistrationDaoTestHelper.getTestJobActions2(), NotificationRegistrationStatusEntity.DISABLED); when(storageUnitNotificationRegistrationService.updateStorageUnitNotificationRegistration(notificationRegistrationKey, request)) .thenReturn(storageUnitNotificationRegistration); // Update the business object data notification registration. StorageUnitNotificationRegistration resultStorageUnitNotificationRegistration = storageUnitNotificationRegistrationRestController.updateStorageUnitNotificationRegistration(NAMESPACE, NOTIFICATION_NAME, request); // Verify the external calls. verify(storageUnitNotificationRegistrationService).updateStorageUnitNotificationRegistration(notificationRegistrationKey, request); verifyNoMoreInteractions(storageUnitNotificationRegistrationService); // Validate the returned object. assertEquals(storageUnitNotificationRegistration, resultStorageUnitNotificationRegistration); }
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(),
if (notificationEventTypeEntity == null) notificationRegistrationDaoTestHelper.createNotificationEventTypeEntity(notificationEventType);
@Test public void testGetBusinessObjectDataNotificationRegistrationsByNotificationFilterLowerCaseParameters() { // 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 lower case input parameters. assertEquals(new BusinessObjectDataNotificationRegistrationKeys(Arrays.asList(notificationRegistrationKey)), businessObjectDataNotificationRegistrationService.getBusinessObjectDataNotificationRegistrationsByNotificationFilter( 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))); }
@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 testUpdateBusinessObjectDataNotificationRegistration() { NotificationRegistrationKey notificationRegistrationKey = new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME); // Create database entities required for testing. notificationRegistrationServiceTestHelper.createDatabaseEntitiesForBusinessObjectDataNotificationRegistrationTesting(NAMESPACE, Arrays .asList(NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN.name()), BDEF_NAMESPACE_2, BDEF_NAME_2, Arrays.asList(FORMAT_FILE_TYPE_CODE, FORMAT_FILE_TYPE_CODE_2), Arrays.asList(STORAGE_NAME, STORAGE_NAME_2), Arrays.asList(BDATA_STATUS, BDATA_STATUS_2, BDATA_STATUS_3, BDATA_STATUS_4), notificationRegistrationDaoTestHelper.getTestJobActions2()); // 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); // Update the business object data notification registration. BusinessObjectDataNotificationRegistration resultBusinessObjectDataNotificationRegistration = businessObjectDataNotificationRegistrationService .updateBusinessObjectDataNotificationRegistration(new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME), new BusinessObjectDataNotificationRegistrationUpdateRequest(NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, BDATA_STATUS_3, NO_BDATA_STATUS), notificationRegistrationDaoTestHelper.getTestJobActions2(), NotificationRegistrationStatusEntity.DISABLED)); // Validate the returned object. assertEquals(new BusinessObjectDataNotificationRegistration(resultBusinessObjectDataNotificationRegistration.getId(), notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN.name(), new BusinessObjectDataNotificationFilter(BDEF_NAMESPACE_2, BDEF_NAME_2, FORMAT_USAGE_CODE_2, FORMAT_FILE_TYPE_CODE_2, FORMAT_VERSION_2, STORAGE_NAME_2, BDATA_STATUS_3, NO_BDATA_STATUS), notificationRegistrationDaoTestHelper.getTestJobActions2(), NotificationRegistrationStatusEntity.DISABLED), resultBusinessObjectDataNotificationRegistration); }
/** * Create and persist database entities required for testing. */ public void createDatabaseEntitiesForBusinessObjectDataNotificationRegistrationTesting() { createDatabaseEntitiesForBusinessObjectDataNotificationRegistrationTesting(AbstractServiceTest.NAMESPACE, Arrays .asList(NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_RGSTN.name(), NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name(), AbstractServiceTest.NOTIFICATION_EVENT_TYPE), AbstractServiceTest.BDEF_NAMESPACE, AbstractServiceTest.BDEF_NAME, Arrays.asList(AbstractServiceTest.FORMAT_FILE_TYPE_CODE), Arrays.asList(AbstractServiceTest.STORAGE_NAME), Arrays.asList(AbstractServiceTest.BDATA_STATUS, AbstractServiceTest.BDATA_STATUS_2), notificationRegistrationDaoTestHelper.getTestJobActions()); }
notificationRegistrationDaoTestHelper.createBusinessObjectDataNotificationRegistrationEntity(notificationRegistrationKey, NotificationEventTypeEntity.EventTypesBdata.BUS_OBJCT_DATA_STTS_CHG.name().toLowerCase(), BDEF_NAMESPACE.toLowerCase(), BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), FORMAT_VERSION, STORAGE_NAME.toLowerCase(), BDATA_STATUS.toLowerCase(),
if (notificationEventTypeEntity == null) notificationEventTypeEntity = createNotificationEventTypeEntity(notificationEventTypeCode); if (notificationRegistrationStatusEntity == null) notificationRegistrationStatusEntity = createNotificationRegistrationStatusEntity(notificationRegistrationStatus);