/**
   * Tests getting a CertificateUser for success.
   *
   * @throws Exception if the test fails.
   */
  @Test
  public void testGetCertificateUserForSuccess() throws Exception {

    X509Certificate certificate =
        CertUtil.loadCertificate(
            getClass().getResourceAsStream(AuthenticationTestConstants.USERCERT_RCE_ENGINEER_PEM));
    User certificateUser = authService.createUser(certificate, validityInDays);

    assertTrue(certificateUser.isValid());
  }
 /** Tests authentication at LDAP for success. */
 @Test
 public void testCreateUser() {
   User user = authService.createUser(4);
   assertEquals(4, user.getValidityInDays());
 }
 /**
  * Tests getting an LDAPUser for success.
  *
  * @throws Exception if the test fails.
  */
 @Test
 public void testGetLdapUserForSuccess() throws Exception {
   User ldapUser = authService.createUser("testUser", validityInDays);
   assertTrue(ldapUser.isValid());
 }