@Test
public void findActiveVersion_whenCaNameRefersToNonCa_throwsException() {

  when(certificateVersionDataService.findActive(any(String.class))).thenReturn(mock(PasswordCredentialVersion.class));
  try {
    certificateAuthorityService.findActiveVersion("any non-ca name");
  } catch (final ParameterizedValidationException pe) {
    assertThat(pe.getMessage(), equalTo(ErrorMessages.NOT_A_CA_NAME));
  }
}