@Test
public void findActiveVersion_whenCredentialIsNotACa_throwsException() {

  when(certificateVersionDataService.findActive("actually-a-password"))
    .thenReturn(new PasswordCredentialVersion());
  try {
    certificateAuthorityService.findActiveVersion("actually-a-password");
  } catch (final ParameterizedValidationException pe) {
    assertThat(pe.getMessage(), equalTo(ErrorMessages.NOT_A_CA_NAME));
  } catch (final Exception e) {
    fail("expected EntryNotFoundException, but got " + e.getClass());
  }
}