test_class.declarator: userNamespaceAuthorizationChangeMessageBuilder
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private UserNamespaceAuthorizationChangeMessageBuilder userNamespaceAuthorizationChangeMessageBuilder;
test_class.type: UserNamespaceAuthorizationChangeMessageBuilder
test_class.var_name: userNamespaceAuthorizationChangeMessageBuilder
test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/helper/notification/UserNamespaceAuthorizationChangeMessageBuilderTest.java
test_class.identifier: UserNamespaceAuthorizationChangeMessageBuilderTest
test_class.superclass: extends AbstractNotificationMessageBuilderTestHelper
test_case.body: @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"));
      }
test_case.class_method_signature: UserNamespaceAuthorizationChangeMessageBuilderTest.testgetUserNamespaceAuthorizationChangeMessageVelocityContextMap()
test_case.full_signature: @Test public void testgetUserNamespaceAuthorizationChangeMessageVelocityContextMap()
test_case.identifier: testgetUserNamespaceAuthorizationChangeMessageVelocityContextMap
test_case.invocations: getNotificationMessageVelocityContextMap assertEquals size assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testgetUserNamespaceAuthorizationChangeMessageVelocityContextMap()
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/helper/notification/UserNamespaceAuthorizationChangeMessageBuilder.java
focal_class.identifier: UserNamespaceAuthorizationChangeMessageBuilder
focal_class.interfaces: implements NotificationMessageBuilder
focal_class.class_method_signature: UserNamespaceAuthorizationChangeMessageBuilder.getNotificationMessageVelocityContextMap(NotificationEvent notificationEvent)
focal_class.full_signature: @Override @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "The NotificationEvent is cast to a UserNamespaceAuthorizationChangeNotificationEvent which is always the case since" + " we manage the event type to a builder in a map defined in NotificationMessageManager") public Map<String, Object> getNotificationMessageVelocityContextMap(NotificationEvent notificationEvent)
focal_class.identifier: getNotificationMessageVelocityContextMap
focal_class.modifiers: @Override @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "The NotificationEvent is cast to a UserNamespaceAuthorizationChangeNotificationEvent which is always the case since" + " we manage the event type to a builder in a map defined in NotificationMessageManager") public
focal_class.parameters: (NotificationEvent notificationEvent)
focal_class.return: Map<String, Object>
focal_class.signature: Map<String, Object> getNotificationMessageVelocityContextMap(NotificationEvent notificationEvent)
focal_class.superclass: extends AbstractNotificationMessageBuilder
focal_method.body: @Override
      @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification =
          "The NotificationEvent is cast to a UserNamespaceAuthorizationChangeNotificationEvent which is always the case since" +
              " we manage the event type to a builder in a map defined in NotificationMessageManager")
      public Map<String, Object> getNotificationMessageVelocityContextMap(NotificationEvent notificationEvent)
      {
          UserNamespaceAuthorizationChangeNotificationEvent event = (UserNamespaceAuthorizationChangeNotificationEvent) notificationEvent;
  
          Map<String, Object> velocityContextMap = new HashMap<>();
  
          addObjectPropertyToContext(velocityContextMap, "userNamespaceAuthorizationKey", event.getUserNamespaceAuthorizationKey(),
              new UserNamespaceAuthorizationKey(escapeJson(event.getUserNamespaceAuthorizationKey().getUserId()),
                  escapeJson(event.getUserNamespaceAuthorizationKey().getNamespace())),
              new UserNamespaceAuthorizationKey(escapeXml(event.getUserNamespaceAuthorizationKey().getUserId()),
                  escapeXml(event.getUserNamespaceAuthorizationKey().getNamespace())));
  
          // Add the namespace Velocity property for the header.
          addStringPropertyToContext(velocityContextMap, "namespace", event.getUserNamespaceAuthorizationKey().getNamespace());
  
          return velocityContextMap;
      }
focal_method.class_method_signature: UserNamespaceAuthorizationChangeMessageBuilder.getNotificationMessageVelocityContextMap(NotificationEvent notificationEvent)
focal_method.full_signature: @Override @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "The NotificationEvent is cast to a UserNamespaceAuthorizationChangeNotificationEvent which is always the case since" + " we manage the event type to a builder in a map defined in NotificationMessageManager") public Map<String, Object> getNotificationMessageVelocityContextMap(NotificationEvent notificationEvent)
focal_method.identifier: getNotificationMessageVelocityContextMap
focal_method.invocations: addObjectPropertyToContext getUserNamespaceAuthorizationKey escapeJson getUserId getUserNamespaceAuthorizationKey escapeJson getNamespace getUserNamespaceAuthorizationKey escapeXml getUserId getUserNamespaceAuthorizationKey escapeXml getNamespace getUserNamespaceAuthorizationKey addStringPropertyToContext getNamespace getUserNamespaceAuthorizationKey
focal_method.modifiers: @Override @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "The NotificationEvent is cast to a UserNamespaceAuthorizationChangeNotificationEvent which is always the case since" + " we manage the event type to a builder in a map defined in NotificationMessageManager") public
focal_method.parameters: (NotificationEvent notificationEvent)
focal_method.return: Map<String, Object>
focal_method.signature: Map<String, Object> getNotificationMessageVelocityContextMap(NotificationEvent notificationEvent)