use of ninja.utils.Crypto in project ninja by ninjaframework.
the class SessionImplTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
when(ninjaProperties.getInteger(NinjaConstant.sessionExpireTimeInSeconds)).thenReturn(10000);
when(ninjaProperties.getBooleanWithDefault(NinjaConstant.sessionSendOnlyIfChanged, true)).thenReturn(true);
when(ninjaProperties.getBooleanWithDefault(NinjaConstant.sessionTransferredOverHttpsOnly, true)).thenReturn(true);
when(ninjaProperties.getBooleanWithDefault(NinjaConstant.sessionHttpOnly, true)).thenReturn(true);
when(ninjaProperties.getOrDie(NinjaConstant.applicationSecret)).thenReturn(SecretGenerator.generateSecret());
when(ninjaProperties.getOrDie(NinjaConstant.applicationCookiePrefix)).thenReturn("NINJA");
when(clock.currentTimeMillis()).thenReturn(System.currentTimeMillis());
when(ninjaProperties.getBooleanWithDefault(NinjaConstant.applicationCookieEncrypted, false)).thenReturn(encrypted);
encryption = new CookieEncryption(ninjaProperties);
crypto = new Crypto(ninjaProperties);
}
Aggregations