@Test public void testCreateOdeTimData() throws JsonUtilsException { JSONObject testObject = JsonUtils .toJSONObject("{\"metadata\":{\"object\":\"value\"},\"payload\":{\"object\":\"value\"}}"); JSONObject actualOdeTimData = TimTransmogrifier.createOdeTimData(testObject); assertEquals( "{\"metadata\":{\"payloadType\":\"us.dot.its.jpo.ode.model.OdeTimPayload\",\"object\":\"value\"},\"payload\":{\"dataType\":\"TravelerInformation\",\"object\":\"value\"}}", actualOdeTimData.toString()); }
public static JSONObject createOdeTimData(JSONObject timData) { JSONObject metadata = timData.getJSONObject(AppContext.METADATA_STRING); metadata.put("payloadType", OdeTimPayload.class.getName()); metadata.remove(AppContext.ENCODINGS_STRING); JSONObject payload = timData.getJSONObject(AppContext.PAYLOAD_STRING); payload.put(AppContext.DATA_TYPE_STRING, TravelerMessageFromHumanToAsnConverter.TRAVELER_INFORMATION); return timData; }
TimTransmogrifier { public static JSONObject createOdeTimData(JSONObject timData) { JSONObject metadata = timData.getJSONObject(AppContext.METADATA_STRING); metadata.put("payloadType", OdeTimPayload.class.getName()); metadata.remove(AppContext.ENCODINGS_STRING); JSONObject payload = timData.getJSONObject(AppContext.PAYLOAD_STRING); payload.put(AppContext.DATA_TYPE_STRING, TravelerMessageFromHumanToAsnConverter.TRAVELER_INFORMATION); return timData; } }
TimTransmogrifier { public static JSONObject createOdeTimData(JSONObject timData) { JSONObject metadata = timData.getJSONObject(AppContext.METADATA_STRING); metadata.put("payloadType", OdeTimPayload.class.getName()); metadata.remove(AppContext.ENCODINGS_STRING); JSONObject payload = timData.getJSONObject(AppContext.PAYLOAD_STRING); payload.put(AppContext.DATA_TYPE_STRING, TravelerMessageFromHumanToAsnConverter.TRAVELER_INFORMATION); return timData; } private  TimTransmogrifier(); }
TimTransmogrifier { public static JSONObject createOdeTimData(JSONObject timData) { JSONObject metadata = timData.getJSONObject(AppContext.METADATA_STRING); metadata.put("payloadType", OdeTimPayload.class.getName()); metadata.remove(AppContext.ENCODINGS_STRING); JSONObject payload = timData.getJSONObject(AppContext.PAYLOAD_STRING); payload.put(AppContext.DATA_TYPE_STRING, TravelerMessageFromHumanToAsnConverter.TRAVELER_INFORMATION); return timData; } private  TimTransmogrifier(); static String obfuscateRsuPassword(String message); static DdsAdvisorySituationData buildASD(ServiceRequest serviceRequest); static String convertToXml(DdsAdvisorySituationData asd, ObjectNode encodableTidObj,
         OdeMsgMetadata timMetadata, SerialId serialIdJ2735); static void updateRsuCreds(RSU rsu, OdeProperties odeProperties); static JsonNode buildEncodingNode(String name, String type, EncodingRule rule); static JSONObject createOdeTimData(JSONObject timData); }
TimTransmogrifier { public static JSONObject createOdeTimData(JSONObject timData) { JSONObject metadata = timData.getJSONObject(AppContext.METADATA_STRING); metadata.put("payloadType", OdeTimPayload.class.getName()); metadata.remove(AppContext.ENCODINGS_STRING); JSONObject payload = timData.getJSONObject(AppContext.PAYLOAD_STRING); payload.put(AppContext.DATA_TYPE_STRING, TravelerMessageFromHumanToAsnConverter.TRAVELER_INFORMATION); return timData; } private  TimTransmogrifier(); static String obfuscateRsuPassword(String message); static DdsAdvisorySituationData buildASD(ServiceRequest serviceRequest); static String convertToXml(DdsAdvisorySituationData asd, ObjectNode encodableTidObj,
         OdeMsgMetadata timMetadata, SerialId serialIdJ2735); static void updateRsuCreds(RSU rsu, OdeProperties odeProperties); static JsonNode buildEncodingNode(String name, String type, EncodingRule rule); static JSONObject createOdeTimData(JSONObject timData); static final String RSUS_STRING; static final String REQUEST_STRING; }