@Test public void testBuildKeyUsernamePrivateKey() throws Exception { final String username = "username"; final String salt = "salt"; final URI privateKeyLocation = URI.create("/somewhere/on/ze/disk"); final URI serverAddress = URI.create("www.google.com"); final String expected = Base64.encodeBase64String((CacheKeyBuilder.PRIVATE_KEY_SALT + username + salt + privateKeyLocation.toString() + serverAddress.toString()).getBytes("utf-8")); assertThat(builder.buildKey(username, salt, privateKeyLocation, 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);  }