Search in sources :

Example 1 with IPasswordService

use of org.pentaho.platform.api.util.IPasswordService in project pentaho-platform by pentaho.

the class PasswordServiceTest method testPasswordService.

public void testPasswordService() {
    // $NON-NLS-1$
    String password = "password";
    IPasswordService passwordService = new KettlePasswordService();
    String encryptedPassword = null;
    try {
        encryptedPassword = passwordService.encrypt(password);
        String decryptedPassword = passwordService.decrypt(encryptedPassword);
        assertEquals(password, decryptedPassword);
    } catch (PasswordServiceException pse) {
        // $NON-NLS-1$
        fail("should not have thrown the exception");
        pse.printStackTrace();
    }
}
Also used : PasswordServiceException(org.pentaho.platform.api.util.PasswordServiceException) IPasswordService(org.pentaho.platform.api.util.IPasswordService)

Aggregations

IPasswordService (org.pentaho.platform.api.util.IPasswordService)1 PasswordServiceException (org.pentaho.platform.api.util.PasswordServiceException)1