@Test
public void generateCredential_shouldReturnAGeneratedCredential() throws Exception {

  final SshCredentialValue ssh = subject.generateCredential(new SshGenerationParameters());
  verify(keyPairGeneratorMock).generateKeyPair(2048);
  assertThat(ssh.getPublicKey(),
    equalTo(CertificateFormatter.derOf((RSAPublicKey) keyPair.getPublic())));
  assertThat(ssh.getPrivateKey(), equalTo(CertificateFormatter.pemOf(keyPair.getPrivate())));
}