@ModelAttribute public C2 getC2(@ModelAttribute C1 c1, Model model) throws IOException { return updateAndReturn(model, "getC2", new C2()); }
@ModelAttribute public A getA(Model model) throws IOException { return updateAndReturn(model, "getA", new A()); }
@ModelAttribute public B2 getB2(@ModelAttribute B1 b1, Model model) throws IOException { return updateAndReturn(model, "getB2", new B2()); }
@ModelAttribute public C1 getC1(@ModelAttribute B2 b2, Model model) throws IOException { return updateAndReturn(model, "getC1", new C1()); }
@ModelAttribute public C3 getC3(@ModelAttribute C2 c2, Model model) throws IOException { return updateAndReturn(model, "getC3", new C3()); }
@ModelAttribute public B1 getB1(@ModelAttribute A a, Model model) throws IOException { return updateAndReturn(model, "getB1", new B1()); }
@Test public void straightLineDependency() throws Exception { runTest(new StraightLineDependencyController()); assertInvokedBefore("getA", "getB1", "getB2", "getC1", "getC2", "getC3", "getC4"); assertInvokedBefore("getB1", "getB2", "getC1", "getC2", "getC3", "getC4"); assertInvokedBefore("getB2", "getC1", "getC2", "getC3", "getC4"); assertInvokedBefore("getC1", "getC2", "getC3", "getC4"); assertInvokedBefore("getC2", "getC3", "getC4"); assertInvokedBefore("getC3", "getC4"); }
@ModelAttribute public C4 getC4(@ModelAttribute C3 c3, Model model) throws IOException { return updateAndReturn(model, "getC4", new C4()); } }