public void testNextState() {
GrailsWebMockUtil.bindMockWebRequest();
FlashScope fs = new GrailsFlashScope();
fs.put("test","value");
fs.put("fred","flintstone");
fs.getNow().put("barney", "rubble");
assertFalse(fs.isEmpty());
assertEquals("flintstone",fs.get("fred"));
assertEquals("rubble",fs.get("barney"));
assertEquals(3, fs.size());
assertTrue(fs.containsKey("test"));
assertTrue(fs.containsKey("barney"));
assertTrue(fs.containsValue("value"));
assertFalse(fs.containsKey("wilma"));
// the state immediately following this one the map should still contain the previous entries
fs.next();
assertFalse(fs.isEmpty());
assertEquals("flintstone",fs.get("fred"));
assertEquals(2, fs.size());
assertTrue(fs.containsKey("test"));
assertTrue(fs.containsValue("value"));
assertFalse(fs.containsKey("wilma"));
// the next state it should be empty
fs.next();
assertTrue(fs.isEmpty());
assertEquals(0,fs.size());
}