Class BaseNearServiceTest

  • Direct Known Subclasses:
    NearServiceTest

    public abstract class BaseNearServiceTest
    extends java.lang.Object
    Basic support functionality for test case classes
    Since:
    0.0.1
    Author:
    Alexandre Carvalho, Andre Bertolace
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String getPrettyJson​(java.lang.Object jsonObject)
      Prettifies json for assertion consistency
      protected java.lang.String getPrettyJson​(java.lang.String json)
      Prettifies json for assertion consistency
      protected java.lang.String loadJsonFromFile​(java.lang.String filename)
      Loads test json from resources
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • OBJECT_MAPPER

        protected static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
    • Constructor Detail

      • BaseNearServiceTest

        public BaseNearServiceTest()
    • Method Detail

      • loadJsonFromFile

        protected java.lang.String loadJsonFromFile​(java.lang.String filename)
                                             throws java.io.IOException
        Loads test json from resources
        Parameters:
        filename -
        Returns:
        Throws:
        java.io.IOException
      • getPrettyJson

        protected java.lang.String getPrettyJson​(java.lang.String json)
                                          throws com.fasterxml.jackson.databind.JsonMappingException,
                                                 com.fasterxml.jackson.core.JsonProcessingException
        Prettifies json for assertion consistency
        Parameters:
        json - json string to prettify
        Returns:
        prettified json
        Throws:
        com.fasterxml.jackson.databind.JsonMappingException
        com.fasterxml.jackson.core.JsonProcessingException
      • getPrettyJson

        protected java.lang.String getPrettyJson​(java.lang.Object jsonObject)
                                          throws com.fasterxml.jackson.databind.JsonMappingException,
                                                 com.fasterxml.jackson.core.JsonProcessingException
        Prettifies json for assertion consistency
        Parameters:
        jsonObject - object to serialize and prettify
        Returns:
        prettified json
        Throws:
        com.fasterxml.jackson.databind.JsonMappingException
        com.fasterxml.jackson.core.JsonProcessingException