@Test
public void testgetUserNamespaceAuthorizationChangeMessageVelocityContextMap()
{

    // Create a user namespace authorization key with values that require JSON and XML escaping.
    UserNamespaceAuthorizationKey userNamespaceAuthorizationKey =
        new UserNamespaceAuthorizationKey(USER_ID + SUFFIX_UNESCAPED, BDEF_NAMESPACE + SUFFIX_UNESCAPED);
    // Call the method under test.
    Map<String, Object> result = userNamespaceAuthorizationChangeMessageBuilder
        .getNotificationMessageVelocityContextMap(new UserNamespaceAuthorizationChangeNotificationEvent(userNamespaceAuthorizationKey));
    // Create an expected JSON escaped user namespace authorization key.
    UserNamespaceAuthorizationKey expectedUserNamespaceAuthorizationKeyWithJson =
        new UserNamespaceAuthorizationKey(USER_ID + SUFFIX_ESCAPED_JSON, BDEF_NAMESPACE + SUFFIX_ESCAPED_JSON);
    // Create an expected XML escaped user namespace authorization key.
    UserNamespaceAuthorizationKey expectedUserNamespaceAuthorizationKeyWithXml =
        new UserNamespaceAuthorizationKey(USER_ID + SUFFIX_ESCAPED_XML, BDEF_NAMESPACE + SUFFIX_ESCAPED_XML);
    // Validate the results.
    assertEquals(6, CollectionUtils.size(result));
    assertEquals(userNamespaceAuthorizationKey, result.get("userNamespaceAuthorizationKey"));
    assertEquals(expectedUserNamespaceAuthorizationKeyWithJson, result.get("userNamespaceAuthorizationKeyWithJson"));
    assertEquals(expectedUserNamespaceAuthorizationKeyWithXml, result.get("userNamespaceAuthorizationKeyWithXml"));
    assertEquals(BDEF_NAMESPACE + SUFFIX_UNESCAPED, result.get("namespace"));
    assertEquals(BDEF_NAMESPACE + SUFFIX_ESCAPED_JSON, result.get("namespaceWithJson"));
    assertEquals(BDEF_NAMESPACE + SUFFIX_ESCAPED_XML, result.get("namespaceWithXml"));
}