diff --git a/wisdom-test/src/main/java/org/wisdom/test/parents/FakeContext.java b/wisdom-test/src/main/java/org/wisdom/test/parents/FakeContext.java index c6291d7b8..259d8350b 100644 --- a/wisdom-test/src/main/java/org/wisdom/test/parents/FakeContext.java +++ b/wisdom-test/src/main/java/org/wisdom/test/parents/FakeContext.java @@ -592,6 +592,7 @@ public FakeContext setHeader(String name, String... values) { /** * Adds an uploaded files. + * * @param name the name of the field in the form uploading the file. * @param file the file object * @return the current fake context @@ -600,4 +601,28 @@ public FakeContext setAttribute(String name, File file) { files.put(name, new FakeFileItem(file, name)); return this; } + + /** + * Adds data to the session. + * + * @param key the key + * @param value the value + * @return the current fake context + */ + public FakeContext addToSession(String key, String value) { + session.put(key, value); + return this; + } + + /** + * Adds data to the (incoming) flash scope. + * + * @param key the key + * @param value the value + * @return the current fake context + */ + public FakeContext addToFlash(String key, String value) { + flash.put(key, value); + return this; + } }