WW-5063 Adds tests to cover new functionality

This commit is contained in:
Lukasz Lenart
2020-12-24 16:39:29 +01:00
parent f2540192bf
commit fbdcd2c4a7
7 changed files with 117 additions and 13 deletions
@@ -35,6 +35,7 @@ import java.util.regex.Pattern;
import javax.servlet.http.HttpServletResponse;
import com.opensymphony.xwork2.Result;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.util.TestUtils;
@@ -713,6 +714,16 @@ public class JSONResultTest extends StrutsTestCase {
assertEquals("UTF-8", encoding);
}
public void testPassingNullInvocation() throws Exception{
Result result = new JSONResult();
try {
result.execute(null);
fail("Exception should be thrown!");
} catch (IllegalArgumentException e) {
assertEquals("Invocation cannot be null!", e.getMessage());
}
}
@Override
protected void setUp() throws Exception {
super.setUp();