I have got a problem connected with JSONObject.
@Test
public void toUrlTest() throws JSONException {
String url;
JSONObject json = new JSONObject();
json.put"id", 1);
json.put("email", "test@hotmail.com");
url = JSONParser.toURLString(json);
assertEquals("id=1&email=test@hotmail.com", url);
}
The problem is when I am debugging this test, it shows that nothing is put to json object.
json={org.json.JSONObject@826} "null"
I checked everything and I got no clue why this happen. JSONObject works fine in app. It only happens while testing.
PS. I have added in build.gradle this
testOptions {
unitTests.returnDefaultValues = true
}
android.jar
contains only signatures of classes, not the implementation. Run the tests on device.