use of keywhiz.service.crypto.ContentCryptographer in project keywhiz by square.
the class SecretControllerMockTest method createController.
private SecretController createController(Long maximumSecretSizeInBytesInclusive) {
KeywhizConfig config = new KeywhizConfig();
config.setMaximumSecretSizeInBytesInclusive(maximumSecretSizeInBytesInclusive);
ContentCryptographer cryptographer = mock(ContentCryptographer.class);
when(cryptographer.computeHmac(any(), any())).thenReturn("hmac");
when(cryptographer.encryptionKeyDerivedFrom(any())).thenReturn(mock(ContentCryptographer.Encrypter.class));
return new SecretController(mock(SecretTransformer.class), cryptographer, mock(SecretDAO.class), mock(AclDAO.class), config);
}
Aggregations