@Test
public void testGetBusinessObjectDataNotificationRegistrationsByNotificationFilter()
{

    // Create a business object data notification filter.
    BusinessObjectDataNotificationFilter businessObjectDataNotificationFilter =
        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);
    // Create notification registration keys.
    BusinessObjectDataNotificationRegistrationKeys businessObjectDataNotificationRegistrationKeys =
        new BusinessObjectDataNotificationRegistrationKeys(Arrays.asList(new NotificationRegistrationKey(NAMESPACE, NOTIFICATION_NAME)));
    // Create a mock servlet request that contains hard coded business object data notification filter parameters.
    MockHttpServletRequest servletRequest = new MockHttpServletRequest();
    servletRequest.setParameter("businessObjectDefinitionNamespace", BDEF_NAMESPACE);
    servletRequest.setParameter("businessObjectDefinitionName", BDEF_NAME);
    servletRequest.setParameter("businessObjectFormatUsage", FORMAT_USAGE_CODE);
    servletRequest.setParameter("businessObjectFormatFileType", FORMAT_FILE_TYPE_CODE);
    // Mock the external calls.
    when(businessObjectDataNotificationRegistrationService
        .getBusinessObjectDataNotificationRegistrationsByNotificationFilter(businessObjectDataNotificationFilter))
        .thenReturn(businessObjectDataNotificationRegistrationKeys);
    // Call the method under test.
    BusinessObjectDataNotificationRegistrationKeys result = businessObjectDataNotificationRegistrationRestController
        .getBusinessObjectDataNotificationRegistrationsByNotificationFilter(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE,
            servletRequest);
    // Verify the external calls.
    verify(businessObjectDataNotificationRegistrationService)
        .getBusinessObjectDataNotificationRegistrationsByNotificationFilter(businessObjectDataNotificationFilter);
    verifyNoMoreInteractionsHelper();
    // Validate the results.
    assertEquals(businessObjectDataNotificationRegistrationKeys, result);
}