@Test public void shouldCreateCorrectBase64() { Credentials credentials = new Credentials("alex", "alex"); assertThat(credentials.toBase64(), is(equalTo("YWxleDphbGV4"))); }
public String toBase64() { String credentialsAsString = name + ":" + password; return Base64.encodeBase64String(credentialsAsString.getBytes()); }
Credentials implements Serializable { public String toBase64() { String credentialsAsString = name + ":" + password; return Base64.encodeBase64String(credentialsAsString.getBytes()); } }
Credentials implements Serializable { public String toBase64() { String credentialsAsString = name + ":" + password; return Base64.encodeBase64String(credentialsAsString.getBytes()); } Credentials();  Credentials(String name, String password); }
Credentials implements Serializable { public String toBase64() { String credentialsAsString = name + ":" + password; return Base64.encodeBase64String(credentialsAsString.getBytes()); } Credentials();  Credentials(String name, String password); String toBase64(); boolean areValid(); String getName(); void setName(String name); String getPassword(); void setPassword(String password); }
Credentials implements Serializable { public String toBase64() { String credentialsAsString = name + ":" + password; return Base64.encodeBase64String(credentialsAsString.getBytes()); } Credentials();  Credentials(String name, String password); String toBase64(); boolean areValid(); String getName(); void setName(String name); String getPassword(); void setPassword(String password);  }