test_class.declarator: jsonHelper
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private JsonHelper jsonHelper;
test_class.type: JsonHelper
test_class.var_name: jsonHelper
test_class.file: herd-code/herd-dao/src/test/java/org/finra/herd/dao/helper/JsonHelperTest.java
test_class.identifier: JsonHelperTest
test_class.superclass: extends AbstractDaoTest
test_case.body: @Test
      public void testObjectToJsonValidateNoStackOverflowErrorWithCircularDependency()
      {
          // Create a business object definition entity.
          BusinessObjectDefinitionEntity businessObjectDefinitionEntity = businessObjectDefinitionDaoTestHelper
              .createBusinessObjectDefinitionEntity(BDEF_NAMESPACE, BDEF_NAME, DATA_PROVIDER_NAME, BDEF_DESCRIPTION, NO_ATTRIBUTES);
  
          // Create a business object format entity.
          BusinessObjectFormatEntity businessObjectFormatEntity = businessObjectFormatDaoTestHelper
              .createBusinessObjectFormatEntity(businessObjectDefinitionEntity, FORMAT_USAGE_CODE,
                  fileTypeDaoTestHelper.createFileTypeEntity(FORMAT_FILE_TYPE_CODE, null), FORMAT_VERSION, FORMAT_DESCRIPTION, FORMAT_DOCUMENT_SCHEMA,
                  FORMAT_DOCUMENT_SCHEMA_URL, LATEST_VERSION_FLAG_SET, PARTITION_KEY, null, NO_ATTRIBUTES, SCHEMA_DELIMITER_COMMA,
                  SCHEMA_COLLECTION_ITEMS_DELIMITER_COMMA, SCHEMA_MAP_KEYS_DELIMITER_HASH, SCHEMA_ESCAPE_CHARACTER_BACKSLASH, SCHEMA_CUSTOM_ROW_FORMAT,
                  SCHEMA_CUSTOM_CLUSTERED_BY_VALUE, SCHEMA_NULL_VALUE_BACKSLASH_N, NO_COLUMNS, NO_PARTITION_COLUMNS);
  
          // Introduce circular dependency to the business object format parent/child relationship.
          businessObjectFormatEntity.setBusinessObjectFormatParents(Arrays.asList(businessObjectFormatEntity));
          businessObjectFormatEntity.setBusinessObjectFormatChildren(Arrays.asList(businessObjectFormatEntity));
          businessObjectFormatDao.saveAndRefresh(businessObjectFormatEntity);
  
          // Create a JSON object from the business object definition entity.
          assertNotNull(jsonHelper.objectToJson(businessObjectDefinitionEntity));
      }
test_case.class_method_signature: JsonHelperTest.testObjectToJsonValidateNoStackOverflowErrorWithCircularDependency()
test_case.full_signature: @Test public void testObjectToJsonValidateNoStackOverflowErrorWithCircularDependency()
test_case.identifier: testObjectToJsonValidateNoStackOverflowErrorWithCircularDependency
test_case.invocations: createBusinessObjectDefinitionEntity createBusinessObjectFormatEntity createFileTypeEntity setBusinessObjectFormatParents asList setBusinessObjectFormatChildren asList saveAndRefresh assertNotNull objectToJson
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testObjectToJsonValidateNoStackOverflowErrorWithCircularDependency()
focal_class.file: herd-code/herd-dao/src/main/java/org/finra/herd/dao/helper/JsonHelper.java
focal_class.identifier: JsonHelper
focal_class.class_method_signature: JsonHelper.getKeyValue(JSONObject jsonObject, Object key, Class<T> classType)
focal_class.full_signature: public T getKeyValue(JSONObject jsonObject, Object key, Class<T> classType)
focal_class.identifier: getKeyValue
focal_class.modifiers: public
focal_class.parameters: (JSONObject jsonObject, Object key, Class<T> classType)
focal_class.return: T
focal_class.signature: T getKeyValue(JSONObject jsonObject, Object key, Class<T> classType)
focal_class.class_method_signature: JsonHelper.objectToJson(Object object)
focal_class.full_signature: public String objectToJson(Object object)
focal_class.identifier: objectToJson
focal_class.modifiers: public
focal_class.parameters: (Object object)
focal_class.return: String
focal_class.signature: String objectToJson(Object object)
focal_class.class_method_signature: JsonHelper.unmarshallJsonToListOfObjects(Class<T> classType, String jsonContent)
focal_class.full_signature: public List<T> unmarshallJsonToListOfObjects(Class<T> classType, String jsonContent)
focal_class.identifier: unmarshallJsonToListOfObjects
focal_class.modifiers: public
focal_class.parameters: (Class<T> classType, String jsonContent)
focal_class.return: List<T>
focal_class.signature: List<T> unmarshallJsonToListOfObjects(Class<T> classType, String jsonContent)
focal_class.class_method_signature: JsonHelper.unmarshallJsonToObject(Class<T> classType, String jsonContent)
focal_class.full_signature: public T unmarshallJsonToObject(Class<T> classType, String jsonContent)
focal_class.identifier: unmarshallJsonToObject
focal_class.modifiers: public
focal_class.parameters: (Class<T> classType, String jsonContent)
focal_class.return: T
focal_class.signature: T unmarshallJsonToObject(Class<T> classType, String jsonContent)
focal_method.body: public String objectToJson(Object object) throws IllegalStateException
      {
          ObjectMapper mapper = new ObjectMapper();
  
          StringWriter stringWriter = new StringWriter();
  
          try
          {
              mapper.writeValue(stringWriter, object);
          }
          catch (IOException e)
          {
              throw new IllegalStateException(e);
          }
  
          return stringWriter.toString();
      }
focal_method.class_method_signature: JsonHelper.objectToJson(Object object)
focal_method.full_signature: public String objectToJson(Object object)
focal_method.identifier: objectToJson
focal_method.invocations: writeValue toString
focal_method.modifiers: public
focal_method.parameters: (Object object)
focal_method.return: String
focal_method.signature: String objectToJson(Object object)