@Test public void testEncode() { String rawPassword = "p@ssW0rd"; String actual = sut.encode(rawPassword); assertThat(actual, startsWith("baz_")); }
@Override public String encode(CharSequence rawPassword) { String encoded = encoders.get(primaryEncoder).encode(rawPassword); return String.format(Locale.ENGLISH, "%s_%s", primaryEncoder, encoded); }
VersionedPasswordEncoder implements PasswordEncoder { @Override public String encode(CharSequence rawPassword) { String encoded = encoders.get(primaryEncoder).encode(rawPassword); return String.format(Locale.ENGLISH, "%s_%s", primaryEncoder, encoded); } }
VersionedPasswordEncoder implements PasswordEncoder { @Override public String encode(CharSequence rawPassword) { String encoded = encoders.get(primaryEncoder).encode(rawPassword); return String.format(Locale.ENGLISH, "%s_%s", primaryEncoder, encoded); } VersionedPasswordEncoder();  VersionedPasswordEncoder(String unknownEncoder, String primaryEncoder,
			Map<String, PasswordEncoder> encoders); }
VersionedPasswordEncoder implements PasswordEncoder { @Override public String encode(CharSequence rawPassword) { String encoded = encoders.get(primaryEncoder).encode(rawPassword); return String.format(Locale.ENGLISH, "%s_%s", primaryEncoder, encoded); } VersionedPasswordEncoder();  VersionedPasswordEncoder(String unknownEncoder, String primaryEncoder,
			Map<String, PasswordEncoder> encoders); @Override String encode(CharSequence rawPassword); @Override boolean matches(CharSequence rawPassword, String encodedPassword); }
VersionedPasswordEncoder implements PasswordEncoder { @Override public String encode(CharSequence rawPassword) { String encoded = encoders.get(primaryEncoder).encode(rawPassword); return String.format(Locale.ENGLISH, "%s_%s", primaryEncoder, encoded); } VersionedPasswordEncoder();  VersionedPasswordEncoder(String unknownEncoder, String primaryEncoder,
			Map<String, PasswordEncoder> encoders); @Override String encode(CharSequence rawPassword); @Override boolean matches(CharSequence rawPassword, String encodedPassword);  }