Пример #1
0
 @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");
 }
Пример #2
0
 @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"));
 }