Code example for PasswordCallback

Methods: getPassword

0
     *  Tests that the callback handler can correctly retrieve the password from the connection url. 
     */ 
    public void testPasswordCallback() throws Exception 
    { 
        final String expectedPassword = "password";
        PasswordCallback passwordCallback = new PasswordCallback(PROMPT_UNUSED, false);
        assertNull("Unexpected password before test", passwordCallback.getPassword());
        _callbackHandler.handle(new Callback[] {passwordCallback});
        assertEquals("Unexpected password", expectedPassword, new String(passwordCallback.getPassword()));
    }     
} 
Connect your IDE to all the code out there  Get Codota for Java