User { public void save() throws IOException, GeneralSecurityException { if (!this.isVerified()) { this.setUnauthenticatedPassword(this.getPassword()); this.setDbKey(getUnauthenticatedDbKey()); } getSharedPreferences().edit().putString(prefKey(userName), asEncryptedJSON()).commit(); } protected  User();  User(String userName);  User(String userName, String password);  User(String userName, String password, boolean authenticated);  User(String userName, String password, boolean authenticated, String serverUrl); String getDbName(); String asJSON(); String asEncryptedJSON(); User read(String json); User load(); void save(); boolean exists(); static User readFromJSON(String json); static final ObjectMapper JSON_MAPPER; static final String UNAUTHENTICATED_DB_KEY; static final String UNAUTHENTICATED_DB_NAME; }
@Test public void shouldSavePlainTextPasswordForUnverified() throws IOException, GeneralSecurityException { user.setVerified(false); user.save(); verify(user).setUnauthenticatedPassword(user.getPassword()); }