I have been looking at this for an hour and can't seem to see what's wrong.
JSONObject jsonResponse = new JSONObject();
jsonResponse.put("JSON", "hi");
String myString = jsonResponse.getString("JSON");
assertEquals("hi", myString);
Result... (The entire method throws Throwable). I tried try/catch as well. Same result....
java.lang.AssertionError:
Expected :hi
Actual :null
This is the class I am using
public class ECUserTests(){
@org.junit.Test
public void testUserExists(){
try{
JSONObject jsonResponse = new JSONObject();
jsonResponse.put("JSON", "Hello, World!");
String myString = jsonResponse.getString("JSON");
assertEquals("hi", myString);
}catch(JSONException e){
e.printStackTrace();
}