new FacesRequest() {
@Override
protected void invokeApplication() throws Exception
{
Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
setValue("#{identity.username}", "gavin");
setValue("#{identity.password}", "foobar");
invokeMethod("#{identity.login}");
}