@Test
public void testSignAgentCrtBadPassphrase() throws Exception {

  Injector injector = getInjector();
  Configuration configuration = injector.getInstance(Configuration.class);
  expect(configuration.validateAgentHostnames()).andReturn(true).once();
  expect(configuration.getConfigsMap()).andReturn(Collections.singletonMap(Configuration.PASSPHRASE.getKey(), "some_passphrase")).once();
  replayAll();
  CertificateManager certificateManager = new CertificateManager();
  injector.injectMembers(certificateManager);
  SignCertResponse response = certificateManager.signAgentCrt("host1.example.com", "crtContent", "passphrase");
  verifyAll();
  Assert.assertEquals(SignCertResponse.ERROR_STATUS, response.getResult());
  Assert.assertEquals("Incorrect passphrase from the agent", response.getMessage());
}