+ public JSONObject getSubJsonObject() {
+ return new JSONObject("{\"delivery\": {\"url\": \"http://172.18.0.3:7070/\", \"user\": "
+ + "\"LOGIN\", \"password\": \"PASSWORD\", \"use100\": true}, \"metadataOnly\": false, "
+ + "\"suspend\": false, \"groupid\": 29, \"subscriber\": \"sg481n\"}");
+ }
+
+ @Test
+ public void Given_Debug_Is_Enabled_Hash_Feed_Passwords_Successful() {
+ JSONObject hashed_feed_pass = BaseServlet.hashPasswords(getFeedJsonObject());
+ assertNotEquals(hashed_feed_pass.getJSONObject("authorization").getJSONArray("endpoint_ids")
+ .getJSONObject(0).get("password").toString(), "demo123456!");
+
+ }
+
+ @Test
+ public void Given_Debug_Is_Enabled_Hash_Sub_Passwords_Successful() {
+ JSONObject hashed_sub_pass = BaseServlet.hashPasswords(getSubJsonObject());
+ assertNotEquals(hashed_sub_pass.getJSONObject("delivery").get("password").toString(), "PASSWORD");
+
+ }
+