Class JsonUtilsTest
java.lang.Object
test.de.iip_ecosphere.platform.support.iip_aas.JsonUtilsTest
Tests
JsonUtils.- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA data object for testing.(package private) static classJson class as it would be generated for -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidassertEscapeUnescape(String string) Asserts that escaping and unescaping leads back to the inputstring.voidTestsJsonUtils.escape(String)andJsonUtils.unescape(String).voidTestsJsonUtils.exceptFields(ObjectMapper, String...)andJsonUtils.toJson(ObjectMapper, Object).voidTestsJsonUtils.handleIipDataClasses(ObjectMapper).voidTests optional values.voidTests the mapping property naming strategy.voidTests the from/to JSON functions forServerAddress.voidTests the generic from/to JSON functions.
-
Constructor Details
-
JsonUtilsTest
public JsonUtilsTest()
-
-
Method Details
-
testOptionals
public void testOptionals()Tests optional values. -
testToFromJson
public void testToFromJson()Tests the generic from/to JSON functions. -
testServerAddress
public void testServerAddress()Tests the from/to JSON functions forServerAddress. -
testEscapeUnescape
public void testEscapeUnescape()TestsJsonUtils.escape(String)andJsonUtils.unescape(String). -
assertEscapeUnescape
Asserts that escaping and unescaping leads back to the inputstring.- Parameters:
string- the string to use
-
testIipTypes
public void testIipTypes() throws com.fasterxml.jackson.core.JsonProcessingExceptionTestsJsonUtils.handleIipDataClasses(ObjectMapper).- Throws:
com.fasterxml.jackson.core.JsonProcessingException- shall not occur
-
testPropertyNaming
public void testPropertyNaming() throws com.fasterxml.jackson.core.JsonProcessingExceptionTests the mapping property naming strategy.- Throws:
com.fasterxml.jackson.core.JsonProcessingException- shall not occur
-
testExceptFields
public void testExceptFields()TestsJsonUtils.exceptFields(ObjectMapper, String...)andJsonUtils.toJson(ObjectMapper, Object).
-