add usage of isEmpty method

This commit is contained in:
Andrei Paikin
2018-05-25 22:47:05 +03:00
parent 20d90bfb0b
commit d00501eabd
6 changed files with 17 additions and 17 deletions

View File

@@ -34,7 +34,7 @@ public class XMLTest {
public void shouldHandleNullXML() {
String xmlStr = null;
JSONObject jsonObject = XML.toJSONObject(xmlStr);
assertTrue("jsonObject should be empty", jsonObject.length() == 0);
assertTrue("jsonObject should be empty", jsonObject.isEmpty());
}
/**
@@ -45,7 +45,7 @@ public class XMLTest {
String xmlStr = "";
JSONObject jsonObject = XML.toJSONObject(xmlStr);
assertTrue("jsonObject should be empty", jsonObject.length() == 0);
assertTrue("jsonObject should be empty", jsonObject.isEmpty());
}
/**
@@ -55,7 +55,7 @@ public class XMLTest {
public void shouldHandleNonXML() {
String xmlStr = "{ \"this is\": \"not xml\"}";
JSONObject jsonObject = XML.toJSONObject(xmlStr);
assertTrue("xml string should be empty", jsonObject.length() == 0);
assertTrue("xml string should be empty", jsonObject.isEmpty());
}
/**
@@ -200,7 +200,7 @@ public class XMLTest {
public void shouldHandleEmptyJSONXML() {
JSONObject jsonObject= new JSONObject();
String xmlStr = XML.toString(jsonObject);
assertTrue("xml string should be empty", xmlStr.length() == 0);
assertTrue("xml string should be empty", xmlStr.isEmpty());
}
/**