@Test public void testBuildKeyUsernamePassword() throws Exception { final String username = "username"; final String password = "password"; final URI serverAddress = URI.create("www.google.com"); final String expected = Base64.encodeBase64String( (CacheKeyBuilder.USERNAME_PASSWORD_SALT + username + password + serverAddress.toString()) .getBytes("utf-8")); assertThat(builder.buildKey(username, password, serverAddress)).isEqualTo(expected); }
@Override public String buildKey(final String username, final String password, final URI serverAddress) { try { return Base64.encodeBase64String( (USERNAME_PASSWORD_SALT + username + password + serverAddress.toString()).getBytes("utf-8")); } catch (final UnsupportedEncodingException e) { throw new Error(e); } }
CacheKeyBuilder implements IdentifierGenerator { @Override public String buildKey(final String username, final String password, final URI serverAddress) { try { return Base64.encodeBase64String( (USERNAME_PASSWORD_SALT + username + password + serverAddress.toString()).getBytes("utf-8")); } catch (final UnsupportedEncodingException e) { throw new Error(e); } } }
CacheKeyBuilder implements IdentifierGenerator { @Override public String buildKey(final String username, final String password, final URI serverAddress) { try { return Base64.encodeBase64String( (USERNAME_PASSWORD_SALT + username + password + serverAddress.toString()).getBytes("utf-8")); } catch (final UnsupportedEncodingException e) { throw new Error(e); } }  }
CacheKeyBuilder implements IdentifierGenerator { @Override public String buildKey(final String username, final String password, final URI serverAddress) { try { return Base64.encodeBase64String( (USERNAME_PASSWORD_SALT + username + password + serverAddress.toString()).getBytes("utf-8")); } catch (final UnsupportedEncodingException e) { throw new Error(e); } }  @Override String buildKey(final String username, final String password, final URI serverAddress); @Override String buildKey(final String username, final String salt, final URI privateKeyLocation,
            final URI serverAddress); }
CacheKeyBuilder implements IdentifierGenerator { @Override public String buildKey(final String username, final String password, final URI serverAddress) { try { return Base64.encodeBase64String( (USERNAME_PASSWORD_SALT + username + password + serverAddress.toString()).getBytes("utf-8")); } catch (final UnsupportedEncodingException e) { throw new Error(e); } }  @Override String buildKey(final String username, final String password, final URI serverAddress); @Override String buildKey(final String username, final String salt, final URI privateKeyLocation,
            final URI serverAddress);  }