test_class.declarator: alternateKeyHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AlternateKeyHelper alternateKeyHelper;
test_class.type: AlternateKeyHelper
test_class.var_name: alternateKeyHelper
test_class.declarator: jsonHelper
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private JsonHelper jsonHelper;
test_class.type: JsonHelper
test_class.var_name: jsonHelper
test_class.declarator: tagHelper
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private TagHelper tagHelper;
test_class.type: TagHelper
test_class.var_name: tagHelper
test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/helper/TagHelperTest.java
test_class.identifier: TagHelperTest
test_class.superclass: extends AbstractServiceTest
test_case.body: @Test
      public void testSafeObjectMapperWriteValueAsStringJsonParseException()
      {
          // Create a tag entity.
          final TagEntity tagEntity = tagDaoTestHelper.createTagEntity(TAG_TYPE, TAG_CODE, TAG_DISPLAY_NAME, TAG_DESCRIPTION);
  
          // Mock the external calls.
          when(jsonHelper.objectToJson(any()))
              .thenThrow(new IllegalStateException(new JsonParseException("Failed to Parse", new JsonLocation("SRC", 100L, 1, 2))));
  
          // Call the method being tested.
          String result = tagHelper.safeObjectMapperWriteValueAsString(tagEntity);
  
          // Verify the external calls.
          verify(jsonHelper).objectToJson(any());
          verifyNoMoreInteractions(alternateKeyHelper, jsonHelper);
  
          // Validate the returned object.
          assertEquals("", result);
      }
test_case.class_method_signature: TagHelperTest.testSafeObjectMapperWriteValueAsStringJsonParseException()
test_case.full_signature: @Test public void testSafeObjectMapperWriteValueAsStringJsonParseException()
test_case.identifier: testSafeObjectMapperWriteValueAsStringJsonParseException
test_case.invocations: createTagEntity thenThrow when objectToJson any safeObjectMapperWriteValueAsString objectToJson verify any verifyNoMoreInteractions assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSafeObjectMapperWriteValueAsStringJsonParseException()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(TagHelper.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(TagHelper.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: alternateKeyHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private AlternateKeyHelper alternateKeyHelper;
focal_class.type: AlternateKeyHelper
focal_class.var_name: alternateKeyHelper
focal_class.declarator: jsonHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private JsonHelper jsonHelper;
focal_class.type: JsonHelper
focal_class.var_name: jsonHelper
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/helper/TagHelper.java
focal_class.identifier: TagHelper
focal_class.class_method_signature: TagHelper.executeFunctionForTagEntities(final String indexName, final List<TagEntity> tagEntities,
          final TriConsumer<String, String, String> function)
focal_class.full_signature: public void executeFunctionForTagEntities(final String indexName, final List<TagEntity> tagEntities,
          final TriConsumer<String, String, String> function)
focal_class.identifier: executeFunctionForTagEntities
focal_class.modifiers: public
focal_class.parameters: (final String indexName, final List<TagEntity> tagEntities,
          final TriConsumer<String, String, String> function)
focal_class.return: void
focal_class.signature: void executeFunctionForTagEntities(final String indexName, final List<TagEntity> tagEntities,
          final TriConsumer<String, String, String> function)
focal_class.class_method_signature: TagHelper.safeObjectMapperWriteValueAsString(final TagEntity tagEntity)
focal_class.full_signature: public String safeObjectMapperWriteValueAsString(final TagEntity tagEntity)
focal_class.identifier: safeObjectMapperWriteValueAsString
focal_class.modifiers: public
focal_class.parameters: (final TagEntity tagEntity)
focal_class.return: String
focal_class.signature: String safeObjectMapperWriteValueAsString(final TagEntity tagEntity)
focal_class.class_method_signature: TagHelper.validateTagKey(TagKey tagKey)
focal_class.full_signature: public void validateTagKey(TagKey tagKey)
focal_class.identifier: validateTagKey
focal_class.modifiers: public
focal_class.parameters: (TagKey tagKey)
focal_class.return: void
focal_class.signature: void validateTagKey(TagKey tagKey)
focal_method.body: public String safeObjectMapperWriteValueAsString(final TagEntity tagEntity)
      {
          String jsonString = "";
  
          try
          {
              // Convert the tag entity to a JSON string
              jsonString = jsonHelper.objectToJson(tagEntity);
          }
          catch (IllegalStateException illegalStateException)
          {
              LOGGER.warn("Could not parse tagEntity id={" + tagEntity.getId() + "} into JSON string. ", illegalStateException);
          }
  
          return jsonString;
      }
focal_method.class_method_signature: TagHelper.safeObjectMapperWriteValueAsString(final TagEntity tagEntity)
focal_method.full_signature: public String safeObjectMapperWriteValueAsString(final TagEntity tagEntity)
focal_method.identifier: safeObjectMapperWriteValueAsString
focal_method.invocations: objectToJson warn getId
focal_method.modifiers: public
focal_method.parameters: (final TagEntity tagEntity)
focal_method.return: String
focal_method.signature: String safeObjectMapperWriteValueAsString(final TagEntity tagEntity)