CE-882 Add methods to make newSession (either with default user id, or specified user id)

This commit is contained in:
2024-04-24 08:34:12 -05:00
parent 57bb39319f
commit e9bcec4c07

View File

@ -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"));
}
/******************************************************************************* /*******************************************************************************
** **
*******************************************************************************/ *******************************************************************************/