mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 13:10:44 +00:00
CE-882 Add methods to make newSession (either with default user id, or specified user id)
This commit is contained in:
@ -40,6 +40,8 @@ public class BaseTest
|
|||||||
{
|
{
|
||||||
private static final QLogger LOG = QLogger.getLogger(BaseTest.class);
|
private static final QLogger LOG = QLogger.getLogger(BaseTest.class);
|
||||||
|
|
||||||
|
public static final String DEFAULT_USER_ID = "001";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
@ -50,15 +52,34 @@ public class BaseTest
|
|||||||
{
|
{
|
||||||
System.setProperty("qqq.logger.logSessionId.disabled", "true");
|
System.setProperty("qqq.logger.logSessionId.disabled", "true");
|
||||||
|
|
||||||
QContext.init(TestUtils.defineInstance(), new QSession()
|
QContext.init(TestUtils.defineInstance(), newSession());
|
||||||
.withUser(new QUser()
|
|
||||||
.withIdReference("001")
|
|
||||||
.withFullName("Anonymous")));
|
|
||||||
resetMemoryRecordStore();
|
resetMemoryRecordStore();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
protected QSession newSession()
|
||||||
|
{
|
||||||
|
return newSession(DEFAULT_USER_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
protected QSession newSession(String userId)
|
||||||
|
{
|
||||||
|
return new QSession().withUser(new QUser()
|
||||||
|
.withIdReference(userId)
|
||||||
|
.withFullName("Anonymous"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
Reference in New Issue
Block a user