StorageUnitNotificationRegistrationRestController extends HerdBaseController { @RequestMapping(value = STORAGE_UNIT_NOTIFICATIONS_URI_PREFIX + "/namespaces/{namespace}/notificationNames/{notificationName}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_STORAGE_UNIT_NOTIFICATION_REGISTRATIONS_PUT) public StorageUnitNotificationRegistration updateStorageUnitNotificationRegistration(@PathVariable("namespace") String namespace, @PathVariable("notificationName") String notificationName, @RequestBody StorageUnitNotificationRegistrationUpdateRequest request) { return storageUnitNotificationRegistrationService .updateStorageUnitNotificationRegistration(new NotificationRegistrationKey(namespace, notificationName), request); }  @RequestMapping(value = STORAGE_UNIT_NOTIFICATIONS_URI_PREFIX, method = RequestMethod.POST, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_STORAGE_UNIT_NOTIFICATION_REGISTRATIONS_POST) StorageUnitNotificationRegistration createStorageUnitNotificationRegistration(@RequestBody StorageUnitNotificationRegistrationCreateRequest request); @RequestMapping(value = STORAGE_UNIT_NOTIFICATIONS_URI_PREFIX + "/namespaces/{namespace}/notificationNames/{notificationName}", method = RequestMethod.DELETE) @Secured(SecurityFunctions.FN_STORAGE_UNIT_NOTIFICATION_REGISTRATIONS_DELETE) StorageUnitNotificationRegistration deleteStorageUnitNotification(@PathVariable("namespace") String namespace,
        @PathVariable("notificationName") String notificationName); @RequestMapping(value = STORAGE_UNIT_NOTIFICATIONS_URI_PREFIX + "/namespaces/{namespace}/notificationNames/{notificationName}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_STORAGE_UNIT_NOTIFICATION_REGISTRATIONS_GET) StorageUnitNotificationRegistration getStorageUnitNotificationRegistration(@PathVariable("namespace") String namespace,
        @PathVariable("notificationName") String notificationName); @RequestMapping(value = STORAGE_UNIT_NOTIFICATIONS_URI_PREFIX + "/namespaces/{namespace}", method = RequestMethod.GET) @Secured(SecurityFunctions.FN_STORAGE_UNIT_NOTIFICATION_REGISTRATIONS_BY_NAMESPACE_GET) StorageUnitNotificationRegistrationKeys getStorageUnitNotificationRegistrationsByNamespace(@PathVariable("namespace") String namespace); @RequestMapping(value = STORAGE_UNIT_NOTIFICATIONS_URI_PREFIX, method = RequestMethod.GET) @Secured(SecurityFunctions.FN_STORAGE_UNIT_NOTIFICATION_REGISTRATIONS_BY_NOTIFICATION_FILTER_GET) StorageUnitNotificationRegistrationKeys getStorageUnitNotificationRegistrationsByNotificationFilter(
        @RequestParam(value = "businessObjectDefinitionNamespace", required = true) String businessObjectDefinitionNamespace,
        @RequestParam(value = "businessObjectDefinitionName", required = true) String businessObjectDefinitionName,
        @RequestParam(value = "businessObjectFormatUsage", required = false) String businessObjectFormatUsage,
        @RequestParam(value = "businessObjectFormatFileType", required = false) String businessObjectFormatFileType, ServletRequest servletRequest); @RequestMapping(value = STORAGE_UNIT_NOTIFICATIONS_URI_PREFIX + "/namespaces/{namespace}/notificationNames/{notificationName}", method = RequestMethod.PUT, consumes = {"application/xml", "application/json"}) @Secured(SecurityFunctions.FN_STORAGE_UNIT_NOTIFICATION_REGISTRATIONS_PUT) StorageUnitNotificationRegistration updateStorageUnitNotificationRegistration(@PathVariable("namespace") String namespace,
        @PathVariable("notificationName") String notificationName, @RequestBody StorageUnitNotificationRegistrationUpdateRequest request); static final String STORAGE_UNIT_NOTIFICATIONS_URI_PREFIX; }
@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); StorageUnitNotificationRegistration resultStorageUnitNotificationRegistration = storageUnitNotificationRegistrationRestController.updateStorageUnitNotificationRegistration(NAMESPACE, NOTIFICATION_NAME, request); verify(storageUnitNotificationRegistrationService).updateStorageUnitNotificationRegistration(notificationRegistrationKey, request); verifyNoMoreInteractions(storageUnitNotificationRegistrationService); assertEquals(storageUnitNotificationRegistration, resultStorageUnitNotificationRegistration); }