test_class.declarator: expectedException = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException expectedException = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: expectedException
test_class.declarator: businessObjectDefinitionDescriptionSuggestionChangeMessageBuilder
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilder businessObjectDefinitionDescriptionSuggestionChangeMessageBuilder;
test_class.type: BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilder
test_class.var_name: businessObjectDefinitionDescriptionSuggestionChangeMessageBuilder
test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/helper/notification/BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilderTest.java
test_class.identifier: BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilderTest
test_class.superclass: extends AbstractNotificationMessageBuilderTestHelper
test_case.body: @Test
      public void testGetBusinessObjectDefinitionDescriptionSuggestionChangeMessageVelocityContextMap()
      {
          // Create a business object definition description suggestion key with values that require JSON and XML escaping.
          BusinessObjectDefinitionDescriptionSuggestionKey businessObjectDefinitionDescriptionSuggestionKey =
              new BusinessObjectDefinitionDescriptionSuggestionKey(BDEF_NAMESPACE + SUFFIX_UNESCAPED, BDEF_NAME + SUFFIX_UNESCAPED, USER_ID + SUFFIX_UNESCAPED);
  
          // Create a business object definition description suggestion with values that require JSON and XML escaping.
          BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestion =
              new BusinessObjectDefinitionDescriptionSuggestion(ID, businessObjectDefinitionDescriptionSuggestionKey, DESCRIPTION_SUGGESTION + SUFFIX_UNESCAPED,
                  BDEF_DESCRIPTION_SUGGESTION_STATUS + SUFFIX_UNESCAPED, USER_ID + SUFFIX_UNESCAPED, CREATED_ON);
  
          // Create and persist a namespace entity.
          NamespaceEntity namespaceEntity = namespaceDaoTestHelper.createNamespaceEntity(businessObjectDefinitionDescriptionSuggestionKey.getNamespace());
  
          // Call the method under test.
          Map<String, Object> result = businessObjectDefinitionDescriptionSuggestionChangeMessageBuilder.getNotificationMessageVelocityContextMap(
              new BusinessObjectDefinitionDescriptionSuggestionChangeNotificationEvent(businessObjectDefinitionDescriptionSuggestion,
                  USER_ID_2 + SUFFIX_UNESCAPED, UPDATED_ON, namespaceEntity.getCode()));
  
          // Create an expected JSON escaped business object definition description suggestion key.
          BusinessObjectDefinitionDescriptionSuggestionKey expectedBusinessObjectDefinitionDescriptionSuggestionKeyWithJson =
              new BusinessObjectDefinitionDescriptionSuggestionKey(BDEF_NAMESPACE + SUFFIX_ESCAPED_JSON, BDEF_NAME + SUFFIX_ESCAPED_JSON,
                  USER_ID + SUFFIX_ESCAPED_JSON);
  
          // Create an expected JSON escaped business object definition description suggestion key.
          BusinessObjectDefinitionDescriptionSuggestion expectedBusinessObjectDefinitionDescriptionSuggestionWithJson =
              new BusinessObjectDefinitionDescriptionSuggestion(ID, expectedBusinessObjectDefinitionDescriptionSuggestionKeyWithJson,
                  DESCRIPTION_SUGGESTION + SUFFIX_ESCAPED_JSON, BDEF_DESCRIPTION_SUGGESTION_STATUS + SUFFIX_ESCAPED_JSON, USER_ID + SUFFIX_ESCAPED_JSON,
                  CREATED_ON);
  
          // Create an expected XML escaped business object definition description suggestion key.
          BusinessObjectDefinitionDescriptionSuggestionKey expectedBusinessObjectDefinitionDescriptionSuggestionKeyWithXml =
              new BusinessObjectDefinitionDescriptionSuggestionKey(BDEF_NAMESPACE + SUFFIX_ESCAPED_XML, BDEF_NAME + SUFFIX_ESCAPED_XML,
                  USER_ID + SUFFIX_ESCAPED_XML);
  
          // Create an expected XML escaped business object definition description suggestion key.
          BusinessObjectDefinitionDescriptionSuggestion expectedBusinessObjectDefinitionDescriptionSuggestionWithXml =
              new BusinessObjectDefinitionDescriptionSuggestion(ID, expectedBusinessObjectDefinitionDescriptionSuggestionKeyWithXml,
                  DESCRIPTION_SUGGESTION + SUFFIX_ESCAPED_XML, BDEF_DESCRIPTION_SUGGESTION_STATUS + SUFFIX_ESCAPED_XML, USER_ID + SUFFIX_ESCAPED_XML, CREATED_ON);
  
          // Create expected notification lists.
          List<String> expectedNotificationList = Lists.newArrayList(USER_ID + SUFFIX_UNESCAPED);
          List<String> expectedNotificationListWithJson = Lists.newArrayList(USER_ID + SUFFIX_ESCAPED_JSON);
          List<String> expectedNotificationListWithXml = Lists.newArrayList(USER_ID + SUFFIX_ESCAPED_XML);
  
          // Validate the results.
          assertEquals(16, CollectionUtils.size(result));
  
          assertEquals(businessObjectDefinitionDescriptionSuggestion, result.get("businessObjectDefinitionDescriptionSuggestion"));
          assertEquals(expectedBusinessObjectDefinitionDescriptionSuggestionWithJson, result.get("businessObjectDefinitionDescriptionSuggestionWithJson"));
          assertEquals(expectedBusinessObjectDefinitionDescriptionSuggestionWithXml, result.get("businessObjectDefinitionDescriptionSuggestionWithXml"));
  
          assertEquals(businessObjectDefinitionDescriptionSuggestionKey, result.get("businessObjectDefinitionDescriptionSuggestionKey"));
          assertEquals(expectedBusinessObjectDefinitionDescriptionSuggestionKeyWithJson, result.get("businessObjectDefinitionDescriptionSuggestionKeyWithJson"));
          assertEquals(expectedBusinessObjectDefinitionDescriptionSuggestionKeyWithXml, result.get("businessObjectDefinitionDescriptionSuggestionKeyWithXml"));
  
          assertEquals(USER_ID_2 + SUFFIX_UNESCAPED, result.get("lastUpdatedByUserId"));
          assertEquals(USER_ID_2 + SUFFIX_ESCAPED_JSON, result.get("lastUpdatedByUserIdWithJson"));
          assertEquals(USER_ID_2 + SUFFIX_ESCAPED_XML, result.get("lastUpdatedByUserIdWithXml"));
  
          assertEquals(UPDATED_ON, result.get("lastUpdatedOn"));
  
          assertEquals(expectedNotificationList, result.get("notificationList"));
          assertEquals(expectedNotificationListWithJson, result.get("notificationListWithJson"));
          assertEquals(expectedNotificationListWithXml, result.get("notificationListWithXml"));
  
          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: BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilderTest.testGetBusinessObjectDefinitionDescriptionSuggestionChangeMessageVelocityContextMap()
test_case.full_signature: @Test public void testGetBusinessObjectDefinitionDescriptionSuggestionChangeMessageVelocityContextMap()
test_case.identifier: testGetBusinessObjectDefinitionDescriptionSuggestionChangeMessageVelocityContextMap
test_case.invocations: createNamespaceEntity getNamespace getNotificationMessageVelocityContextMap getCode newArrayList newArrayList newArrayList assertEquals size assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get assertEquals get 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 testGetBusinessObjectDefinitionDescriptionSuggestionChangeMessageVelocityContextMap()
focal_class.declarator: userNamespaceAuthorizationDao
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private UserNamespaceAuthorizationDao userNamespaceAuthorizationDao;
focal_class.type: UserNamespaceAuthorizationDao
focal_class.var_name: userNamespaceAuthorizationDao
focal_class.declarator: namespaceDao
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private NamespaceDao namespaceDao;
focal_class.type: NamespaceDao
focal_class.var_name: namespaceDao
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/helper/notification/BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilder.java
focal_class.identifier: BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilder
focal_class.interfaces: implements NotificationMessageBuilder
focal_class.class_method_signature: BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilder.getNotificationMessageVelocityContextMap(NotificationEvent notificationEvent)
focal_class.full_signature: @Override @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "The NotificationEvent is cast to a BusinessObjectDefinitionDescriptionSuggestionChangeNotificationEvent 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 BusinessObjectDefinitionDescriptionSuggestionChangeNotificationEvent 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.class_method_signature: BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilder.escapeJsonBusinessObjectDefinitionDescriptionSuggestion(
          final BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestion)
focal_class.full_signature: private BusinessObjectDefinitionDescriptionSuggestion escapeJsonBusinessObjectDefinitionDescriptionSuggestion(
          final BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestion)
focal_class.identifier: escapeJsonBusinessObjectDefinitionDescriptionSuggestion
focal_class.modifiers: private
focal_class.parameters: (
          final BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestion)
focal_class.return: BusinessObjectDefinitionDescriptionSuggestion
focal_class.signature: BusinessObjectDefinitionDescriptionSuggestion escapeJsonBusinessObjectDefinitionDescriptionSuggestion(
          final BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestion)
focal_class.class_method_signature: BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilder.escapeXmlBusinessObjectDefinitionDescriptionSuggestion(
          final BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestion)
focal_class.full_signature: private BusinessObjectDefinitionDescriptionSuggestion escapeXmlBusinessObjectDefinitionDescriptionSuggestion(
          final BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestion)
focal_class.identifier: escapeXmlBusinessObjectDefinitionDescriptionSuggestion
focal_class.modifiers: private
focal_class.parameters: (
          final BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestion)
focal_class.return: BusinessObjectDefinitionDescriptionSuggestion
focal_class.signature: BusinessObjectDefinitionDescriptionSuggestion escapeXmlBusinessObjectDefinitionDescriptionSuggestion(
          final BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestion)
focal_class.class_method_signature: BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilder.escapeXmlBusinessObjectDefinitionDescriptionSuggestionKey(
          final BusinessObjectDefinitionDescriptionSuggestionKey businessObjectDefinitionDescriptionSuggestionKey)
focal_class.full_signature: private BusinessObjectDefinitionDescriptionSuggestionKey escapeXmlBusinessObjectDefinitionDescriptionSuggestionKey(
          final BusinessObjectDefinitionDescriptionSuggestionKey businessObjectDefinitionDescriptionSuggestionKey)
focal_class.identifier: escapeXmlBusinessObjectDefinitionDescriptionSuggestionKey
focal_class.modifiers: private
focal_class.parameters: (
          final BusinessObjectDefinitionDescriptionSuggestionKey businessObjectDefinitionDescriptionSuggestionKey)
focal_class.return: BusinessObjectDefinitionDescriptionSuggestionKey
focal_class.signature: BusinessObjectDefinitionDescriptionSuggestionKey escapeXmlBusinessObjectDefinitionDescriptionSuggestionKey(
          final BusinessObjectDefinitionDescriptionSuggestionKey businessObjectDefinitionDescriptionSuggestionKey)
focal_class.class_method_signature: BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilder.escapeJsonBusinessObjectDefinitionDescriptionSuggestionKey(
          final BusinessObjectDefinitionDescriptionSuggestionKey businessObjectDefinitionDescriptionSuggestionKey)
focal_class.full_signature: private BusinessObjectDefinitionDescriptionSuggestionKey escapeJsonBusinessObjectDefinitionDescriptionSuggestionKey(
          final BusinessObjectDefinitionDescriptionSuggestionKey businessObjectDefinitionDescriptionSuggestionKey)
focal_class.identifier: escapeJsonBusinessObjectDefinitionDescriptionSuggestionKey
focal_class.modifiers: private
focal_class.parameters: (
          final BusinessObjectDefinitionDescriptionSuggestionKey businessObjectDefinitionDescriptionSuggestionKey)
focal_class.return: BusinessObjectDefinitionDescriptionSuggestionKey
focal_class.signature: BusinessObjectDefinitionDescriptionSuggestionKey escapeJsonBusinessObjectDefinitionDescriptionSuggestionKey(
          final BusinessObjectDefinitionDescriptionSuggestionKey businessObjectDefinitionDescriptionSuggestionKey)
focal_class.superclass: extends AbstractNotificationMessageBuilder
focal_method.body: @Override
      @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification =
          "The NotificationEvent is cast to a BusinessObjectDefinitionDescriptionSuggestionChangeNotificationEvent 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)
      {
          BusinessObjectDefinitionDescriptionSuggestionChangeNotificationEvent event =
              (BusinessObjectDefinitionDescriptionSuggestionChangeNotificationEvent) notificationEvent;
  
          // Create a list of users (User IDs) that need to be notified about this event.
          // Initialize the list with the user who created this business object definition description suggestion.
          List<String> notificationList = new ArrayList<>();
          notificationList.add(event.getBusinessObjectDefinitionDescriptionSuggestion().getCreatedByUserId());
  
          NamespaceEntity namespaceEntity = namespaceDao.getNamespaceByCd(event.getNamespace());
          Assert.notNull(namespaceEntity, String.format("namespaceEntity must not be null for namespace code \"%s\"", event.getNamespace()));
  
          // Add to the notification list all users that have WRITE or WRITE_DESCRIPTIVE_CONTENT permission on the namespace.
          notificationList.addAll(userNamespaceAuthorizationDao.getUserIdsWithWriteOrWriteDescriptiveContentPermissionsByNamespace(namespaceEntity));
  
          // Create JSON and XML escaped copies of the business object definition description suggestion.
          BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestionWithJson =
              escapeJsonBusinessObjectDefinitionDescriptionSuggestion(event.getBusinessObjectDefinitionDescriptionSuggestion());
          BusinessObjectDefinitionDescriptionSuggestion businessObjectDefinitionDescriptionSuggestionWithXml =
              escapeXmlBusinessObjectDefinitionDescriptionSuggestion(event.getBusinessObjectDefinitionDescriptionSuggestion());
  
          // Create JSON and XML escaped notification lists.
          List<String> notificationListWithJson = new ArrayList<>();
          List<String> notificationListWithXml = new ArrayList<>();
          for (String userId : notificationList)
          {
              notificationListWithJson.add(escapeJson(userId));
              notificationListWithXml.add(escapeXml(userId));
          }
  
          // Create a context map of values that can be used when building the message.
          Map<String, Object> velocityContextMap = new HashMap<>();
          addObjectPropertyToContext(velocityContextMap, "businessObjectDefinitionDescriptionSuggestion",
              event.getBusinessObjectDefinitionDescriptionSuggestion(), businessObjectDefinitionDescriptionSuggestionWithJson,
              businessObjectDefinitionDescriptionSuggestionWithXml);
          addObjectPropertyToContext(velocityContextMap, "businessObjectDefinitionDescriptionSuggestionKey",
              event.getBusinessObjectDefinitionDescriptionSuggestion().getBusinessObjectDefinitionDescriptionSuggestionKey(),
              businessObjectDefinitionDescriptionSuggestionWithJson.getBusinessObjectDefinitionDescriptionSuggestionKey(),
              businessObjectDefinitionDescriptionSuggestionWithXml.getBusinessObjectDefinitionDescriptionSuggestionKey());
          addStringPropertyToContext(velocityContextMap, "lastUpdatedByUserId", event.getLastUpdatedByUserId());
          velocityContextMap.put("lastUpdatedOn", event.getLastUpdatedOn());
          addObjectPropertyToContext(velocityContextMap, "notificationList", notificationList, notificationListWithJson, notificationListWithXml);
          addStringPropertyToContext(velocityContextMap, "namespace", event.getNamespace());
  
          // Return the Velocity context map.
          return velocityContextMap;
      }
focal_method.class_method_signature: BusinessObjectDefinitionDescriptionSuggestionChangeMessageBuilder.getNotificationMessageVelocityContextMap(NotificationEvent notificationEvent)
focal_method.full_signature: @Override @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "The NotificationEvent is cast to a BusinessObjectDefinitionDescriptionSuggestionChangeNotificationEvent 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: add getCreatedByUserId getBusinessObjectDefinitionDescriptionSuggestion getNamespaceByCd getNamespace notNull format getNamespace addAll getUserIdsWithWriteOrWriteDescriptiveContentPermissionsByNamespace escapeJsonBusinessObjectDefinitionDescriptionSuggestion getBusinessObjectDefinitionDescriptionSuggestion escapeXmlBusinessObjectDefinitionDescriptionSuggestion getBusinessObjectDefinitionDescriptionSuggestion add escapeJson add escapeXml addObjectPropertyToContext getBusinessObjectDefinitionDescriptionSuggestion addObjectPropertyToContext getBusinessObjectDefinitionDescriptionSuggestionKey getBusinessObjectDefinitionDescriptionSuggestion getBusinessObjectDefinitionDescriptionSuggestionKey getBusinessObjectDefinitionDescriptionSuggestionKey addStringPropertyToContext getLastUpdatedByUserId put getLastUpdatedOn addObjectPropertyToContext addStringPropertyToContext getNamespace
focal_method.modifiers: @Override @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "The NotificationEvent is cast to a BusinessObjectDefinitionDescriptionSuggestionChangeNotificationEvent 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)