diff --git a/jpo-ode-svcs/src/test/java/us/dot/its/jpo/ode/traveler/TimDepositControllerTest.java b/jpo-ode-svcs/src/test/java/us/dot/its/jpo/ode/traveler/TimDepositControllerTest.java index e76cd0ced..5c61a856b 100644 --- a/jpo-ode-svcs/src/test/java/us/dot/its/jpo/ode/traveler/TimDepositControllerTest.java +++ b/jpo-ode-svcs/src/test/java/us/dot/its/jpo/ode/traveler/TimDepositControllerTest.java @@ -63,7 +63,7 @@ public void emptyRequestShouldReturnEmptyError() { @Test public void invalidJsonSyntaxShouldReturnJsonSyntaxError() { - ResponseEntity actualResponse = testTimDepositController.postTim("{\"invalid\":\"json\"}}"); + ResponseEntity actualResponse = testTimDepositController.postTim("{\"in\"va}}}on\"}}"); assertEquals("{\"error\":\"Malformed or non-compliant JSON syntax.\"}", actualResponse.getBody()); } @@ -160,4 +160,11 @@ public void testSuccessfulMessageReturnsSuccessMessagePut(@Capturing TimTransmog assertEquals("{\"success\":\"true\"}", actualResponse.getBody()); } + @Test + public void testDepositingTimWithExtraProperties(@Capturing TimTransmogrifier capturingTimTransmogrifier, @Capturing XmlUtils capturingXmlUtils) { + String timToSubmit = "{\"request\":{\"rsus\":[],\"snmp\":{},\"randomProp1\":true,\"randomProp2\":\"hello world\"},\"tim\":{\"msgCnt\":\"13\",\"timeStamp\":\"2017-03-13T01:07:11-05:00\",\"randomProp3\":123,\"randomProp4\":{\"nestedProp1\":\"foo\",\"nestedProp2\":\"bar\"}}}"; + ResponseEntity actualResponse = testTimDepositController.postTim(timToSubmit); + assertEquals("{\"success\":\"true\"}", actualResponse.getBody()); + } + }