@Test(expected = Err.class) public void noSuchFlashAttr() throws Exception { Map<String, String> flash = new HashMap<>(); RequestMock req = new RequestMock() { @Override public Map<String, String> flash() { return flash; } }; req.flash("foo"); }
@Test public void getFlashAttr() throws Exception { Map<String, String> flash = new HashMap<>(); flash.put("foo", "bar"); RequestMock req = new RequestMock() { @Override public Map<String, String> flash() { return flash; } }; assertEquals("bar", req.flash("foo")); }