Skip to content

Commit

Permalink
Adds method to set data into the session and flash scope
Browse files Browse the repository at this point in the history
Signed-off-by: Clement Escoffier <[email protected]>
  • Loading branch information
cescoffier committed Apr 4, 2014
1 parent cacfb54 commit a391bb0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions wisdom-test/src/main/java/org/wisdom/test/parents/FakeContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
}

0 comments on commit a391bb0

Please sign in to comment.