@Test public void testGetRsu() throws IOException { new Expectations() { { mockOdeProperties.getRsuUsername(); result = "v3user"; mockOdeProperties.getRsuPassword(); result = "password"; } }; RSU expected = new RSU("127.0.0.1", "v3user", "password", 1, 2000); RSU actual1 = new RSU("127.0.0.1", null, null, 1, 2000); TimTransmogrifier.updateRsuCreds(actual1, mockOdeProperties); assertEquals(expected, actual1); RSU actual2 = new RSU("127.0.0.1", "v3user", "password", 1, 2000); TimTransmogrifier.updateRsuCreds(actual2, mockOdeProperties); assertEquals(expected, actual2); RSU actual3 = new RSU("127.0.0.1", "", "", 1, 2000); TimTransmogrifier.updateRsuCreds(actual3, mockOdeProperties); assertEquals(expected, actual3); }
public static void updateRsuCreds(RSU rsu, OdeProperties odeProperties) { if (rsu.getRsuUsername() == null || rsu.getRsuUsername().isEmpty()) { rsu.setRsuUsername(odeProperties.getRsuUsername()); } if (rsu.getRsuPassword() == null || rsu.getRsuPassword().isEmpty()) { rsu.setRsuPassword(odeProperties.getRsuPassword()); } }
TimTransmogrifier { public static void updateRsuCreds(RSU rsu, OdeProperties odeProperties) { if (rsu.getRsuUsername() == null || rsu.getRsuUsername().isEmpty()) { rsu.setRsuUsername(odeProperties.getRsuUsername()); } if (rsu.getRsuPassword() == null || rsu.getRsuPassword().isEmpty()) { rsu.setRsuPassword(odeProperties.getRsuPassword()); } } }
TimTransmogrifier { public static void updateRsuCreds(RSU rsu, OdeProperties odeProperties) { if (rsu.getRsuUsername() == null || rsu.getRsuUsername().isEmpty()) { rsu.setRsuUsername(odeProperties.getRsuUsername()); } if (rsu.getRsuPassword() == null || rsu.getRsuPassword().isEmpty()) { rsu.setRsuPassword(odeProperties.getRsuPassword()); } } private  TimTransmogrifier(); }
TimTransmogrifier { public static void updateRsuCreds(RSU rsu, OdeProperties odeProperties) { if (rsu.getRsuUsername() == null || rsu.getRsuUsername().isEmpty()) { rsu.setRsuUsername(odeProperties.getRsuUsername()); } if (rsu.getRsuPassword() == null || rsu.getRsuPassword().isEmpty()) { rsu.setRsuPassword(odeProperties.getRsuPassword()); } } 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 void updateRsuCreds(RSU rsu, OdeProperties odeProperties) { if (rsu.getRsuUsername() == null || rsu.getRsuUsername().isEmpty()) { rsu.setRsuUsername(odeProperties.getRsuUsername()); } if (rsu.getRsuPassword() == null || rsu.getRsuPassword().isEmpty()) { rsu.setRsuPassword(odeProperties.getRsuPassword()); } } 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; }