Search in sources :

Example 1 with Crypto

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);
}
Also used : Crypto(ninja.utils.Crypto) CookieEncryption(ninja.utils.CookieEncryption) Before(org.junit.Before)

Aggregations

CookieEncryption (ninja.utils.CookieEncryption)1 Crypto (ninja.utils.Crypto)1 Before (org.junit.Before)1