@@ -2404,8 +2404,8 @@ public void jsonObjectOptDefault() {
24042404 MyEnum .VAL1 .equals (jsonObject .optEnum (MyEnum .class , "myKey" , MyEnum .VAL1 )));
24052405 assertTrue ("optJSONArray() should return null " ,
24062406 null ==jsonObject .optJSONArray ("myKey" ));
2407- assertTrue ("optJSONObject() should return null " ,
2408- null == jsonObject .optJSONObject ("myKey" ));
2407+ assertTrue ("optJSONObject() should return default JSONObject " ,
2408+ jsonObject .optJSONObject ("myKey" , new JSONObject ( "{ \" testKey \" : \" testValue \" }" )). getString ( "testKey" ). equals ( "testValue " ));
24092409 assertTrue ("optLong() should return default long" ,
24102410 42l == jsonObject .optLong ("myKey" , 42l ));
24112411 assertTrue ("optDouble() should return default double" ,
@@ -2440,8 +2440,8 @@ public void jsonObjectOptNoKey() {
24402440 MyEnum .VAL1 .equals (jsonObject .optEnum (MyEnum .class , "myKey" , MyEnum .VAL1 )));
24412441 assertTrue ("optJSONArray() should return null " ,
24422442 null ==jsonObject .optJSONArray ("myKey" ));
2443- assertTrue ("optJSONObject() should return null " ,
2444- null == jsonObject .optJSONObject ("myKey" ));
2443+ assertTrue ("optJSONObject() should return default JSONObject " ,
2444+ jsonObject .optJSONObject ("myKey" , new JSONObject ( "{ \" testKey \" : \" testValue \" }" )). getString ( "testKey" ). equals ( "testValue " ));
24452445 assertTrue ("optLong() should return default long" ,
24462446 42l == jsonObject .optLong ("myKey" , 42l ));
24472447 assertTrue ("optDouble() should return default double" ,
0 commit comments