@Test public void testIllegalTemplateRenderingWithVarAgs() { EmptyController controller = new EmptyController(); Context context = mock(Context.class); Context.CONTEXT.set(context); Template template = mock(Template.class); Object[] parameters = new Object[]{"foo", "bar", 1, "baz"}; try { controller.render(template, parameters); fail("The third argument should have been seen as illegal"); } catch (IllegalArgumentException e) { } parameters = new Object[]{"foo", "bar", "baz"}; try { controller.render(template, parameters); fail("The fourth argument is missing, it should have been detected"); } catch (IllegalArgumentException e) { } }
public Renderable<?> render(Template template, Map<String, Object> parameters) { return template.render(this, parameters); }
DefaultController extends Results implements Status, HeaderNames, Controller { public Renderable<?> render(Template template, Map<String, Object> parameters) { return template.render(this, parameters); } }
DefaultController extends Results implements Status, HeaderNames, Controller { public Renderable<?> render(Template template, Map<String, Object> parameters) { return template.render(this, parameters); }  }
DefaultController extends Results implements Status, HeaderNames, Controller { public Renderable<?> render(Template template, Map<String, Object> parameters) { return template.render(this, parameters); }  Logger logger(); Context context(); Request request(); SessionCookie session(); void session(String key, String value); String session(String key); FlashCookie flash(); void flash(String key, String value); String flash(String key); List<Route> routes(); Renderable<?> render(Template template, Map<String, Object> parameters); Renderable<?> render(Template template, Object... parameters); Renderable<?> render(Template template); }
DefaultController extends Results implements Status, HeaderNames, Controller { public Renderable<?> render(Template template, Map<String, Object> parameters) { return template.render(this, parameters); }  Logger logger(); Context context(); Request request(); SessionCookie session(); void session(String key, String value); String session(String key); FlashCookie flash(); void flash(String key, String value); String flash(String key); List<Route> routes(); Renderable<?> render(Template template, Map<String, Object> parameters); Renderable<?> render(Template template, Object... parameters); Renderable<?> render(Template template);  }