@Test
public void generateCredential_shouldReturnAGeneratedCredential() throws Exception {

  final RsaCredentialValue rsa = subject.generateCredential(new RsaGenerationParameters());
  verify(keyPairGenerator).generateKeyPair(2048);
  assertThat(rsa.getPublicKey(), equalTo(CertificateFormatter.pemOf(keyPair.getPublic())));
  assertThat(rsa.getPrivateKey(), equalTo(CertificateFormatter.pemOf(keyPair.getPrivate())));
}