public void testDoExecute() throws Exception { MockHttpServletResponse response = JiraTestUtil.setupExpectedRedirect("ViewFieldLayoutSchemes.jspa"); Mock mockFieldLayoutShceme = new Mock(FieldLayoutScheme.class); mockFieldLayoutShceme.setStrict(true); String name = "some name"; mockFieldLayoutShceme.expectVoid("setName", P.args(new IsEqual(name))); String description = "Test Description"; mockFieldLayoutShceme.expectVoid("setDescription", P.args(new IsEqual(description))); mockFieldLayoutShceme.expectVoid("store"); Long id = new Long(1); mockFieldLayoutShceme.expectAndReturn("getId", id); FieldLayoutScheme fieldLayoutScheme = (FieldLayoutScheme) mockFieldLayoutShceme.proxy(); mockFieldLayoutManager.expectAndReturn( "getFieldLayoutSchemes", EasyList.build(fieldLayoutScheme)); mockFieldLayoutManager.expectAndReturn( "getMutableFieldLayoutScheme", P.args(new IsEqual(id)), fieldLayoutScheme); efls.setFieldLayoutSchemeName(name); efls.setFieldLayoutSchemeDescription(description); efls.setId(id); assertEquals(Action.NONE, efls.execute()); response.verify(); mockFieldLayoutShceme.verify(); mockFieldLayoutManager.verify(); }
public void sendRedirect(String redirectURL) throws IOException { this.redirectURL = redirectURL; super.sendRedirect(redirectURL); }
public void setStatus(int i) { this.status = i; super.setStatus(i); }