I am trying to test my action classes with the jUnit plugin. The action is as follows:
@Action(value = "default", results = { @Result(name = "success", type="tiles", location = "login") }) public String defaultAction() { return SUCCESS; }
When I call proxy.execute() , the test fails. I probably forget something that makes my test work with tiles, but I donβt know what it can be. I get the following stack trace:
java.lang.NullPointerException at org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:105) at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:373) ...
When I change the action as shown below, the test runs fine:
@Action(value = "default", results = { @Result(name = "success", type="redirectAction", location = "login") }) public String defaultAction() { return SUCCESS; }
source share