File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 11package org .json .junit ;
22
3- import static org .junit .Assert .*;
3+ import static org .junit .Assert .assertEquals ;
4+ import static org .junit .Assert .assertTrue ;
45
5- import java .io .* ;
6+ import java .io .IOException ;
67
7- import org .json .*;
8- import org .junit .*;
9- import org .junit .rules .*;
8+ import org .json .JSONArray ;
9+ import org .json .JSONException ;
10+ import org .json .JSONObject ;
11+ import org .json .XML ;
12+ import org .junit .Rule ;
13+ import org .junit .Test ;
14+ import org .junit .rules .TemporaryFolder ;
1015
1116
1217/**
@@ -180,12 +185,12 @@ public void shouldHandleInvalidCDATABangInTag() {
180185
181186 /**
182187 * Null JSONObject in XML.toString()
183- * Expects NullPointerException
184188 */
185- @ Test ( expected = NullPointerException . class )
189+ @ Test
186190 public void shouldHandleNullJSONXML () {
187191 JSONObject jsonObject = null ;
188- XML .toString (jsonObject );
192+ String actualXml =XML .toString (jsonObject );
193+ assertEquals ("generated XML does not equal expected XML" ,"\" null\" " ,actualXml );
189194 }
190195
191196 /**
You can’t perform that action at this time.
0 commit comments