@Test
public void testVerifyNonTokenParentPassword() {

    final String application = "application";
    final String parentApplication = "parent-application";
    final String parentPassword = "parent-application_pass";
    final String encryptedParentPassword = "{cipher}" + this.encryptor.encrypt(parentPassword);
    assertTrue(this.configSecurity.verifyParentPassword(application, parentApplication, parentPassword, parentPassword));
    assertTrue(this.configSecurity.verifyParentPassword(application, parentApplication, parentPassword, encryptedParentPassword));
    assertTrue(this.configSecurity.verifyParentPassword(application, parentApplication, encryptedParentPassword, parentPassword));
    // plain text parent password does not contain application info, can not verify by application.
    assertTrue(this.configSecurity.verifyParentPassword(application, "", parentPassword, parentPassword));
    assertTrue(this.configSecurity.verifyParentPassword(application, null, parentPassword, parentPassword));
    assertFalse(this.configSecurity.verifyParentPassword("", parentPassword, parentPassword, parentPassword));
    assertFalse(this.configSecurity.verifyParentPassword(null, parentPassword, parentPassword, parentPassword));
    assertFalse(this.configSecurity.verifyParentPassword(application, parentApplication, parentPassword + "x", parentPassword));
    assertFalse(this.configSecurity.verifyParentPassword(application, parentApplication, parentPassword, parentPassword + "x"));
}