DefaultCredentialsProvider implements CredentialsProvider { @Override public Credentials getCredentials() { return credentialsProvider.getCredentials(); } DefaultCredentialsProvider();  DefaultCredentialsProvider(String usernameKey, String passwordKey);  DefaultCredentialsProvider(String filePath); @Override Credentials getCredentials(); @Override CredentialsProvider refresh();  }
@Test public void testConstructorWithUserParams() { System.setProperty(userNameSysProp, userName); System.setProperty(userPasswordSysProp, userPassword); CredentialsProvider provider = new DefaultCredentialsProvider(userNameSysProp, userPasswordSysProp); Credentials credentials = provider.getCredentials(); assert userName.equals(credentials.getUsername()); assert userPassword.equals(credentials.getPassword()); System.clearProperty(userNameSysProp); System.clearProperty(userPasswordSysProp); }