packageorg.apache.struts.register.action;importcom.opensymphony.xwork2.ActionProxy;importcom.opensymphony.xwork2.ActionSupport;importorg.apache.struts2.StrutsTestCase;importorg.junit.Test;publicclassRegisterTestextendsStrutsTestCase{@TestpublicvoidtestExecuteValidationPasses()throwsException{
request.setParameter("personBean.firstName","Bruce");
request.setParameter("personBean.lastName","Phillips");
request.setParameter("personBean.email","bphillips@ku.edu");
request.setParameter("personBean.age","19");ActionProxy actionProxy =getActionProxy("/register.action");Register action =(Register) actionProxy.getAction();assertNotNull("The action is null but should not be.", action);String result = actionProxy.execute();assertEquals("The execute method did not return "+ActionSupport.SUCCESS +" but should have.",ActionSupport.SUCCESS, result);}}
successful
2022-10-2600:07:14,231 INFO [main]ognl.OgnlUtil(OgnlUtil.java:274)- OGNL ExpressionMaxLength enabled with256.2022-10-2600:07:14,258 WARN [main]ognl.OgnlUtil(OgnlUtil.java:845)-Working in devMode, using devMode excluded classes and packages!Process finished withexit code 0