StaticCredentialsProvider implements CredentialsProvider { @Override public Credentials getCredentials() { return credentials; } StaticCredentialsProvider(String username, String password);  StaticCredentialsProvider(Credentials credentials); @Override Credentials getCredentials(); @Override CredentialsProvider refresh();  }
@Test public void testConstructorWithCredentials() { CredentialsProvider provider = new StaticCredentialsProvider(new Credentials(userName, userPassword)); Credentials credentials = provider.getCredentials(); assert userName.equals(credentials.getUsername()); assert userPassword.equals(credentials.getPassword()); }