@Test
public void fromJSON_whenPreferencesAreValid_savesIncludedGeneralKeys_andResetsMissingGeneralKeys() throws Exception {

    JSONObject content = new JSONObject();
    JSONObject general = new JSONObject();
    content.put("general", general);
    content.put("admin", new JSONObject());
    general.put(KEY_PASSWORD, "password");
    GeneralSharedPreferences generalSharedPreferences = mock(GeneralSharedPreferences.class);
    new PreferenceSaver(generalSharedPreferences, AdminSharedPreferences.getInstance()).fromJSON(content.toString(), mock(ActionListener.class));
    verify(generalSharedPreferences).save(KEY_PASSWORD, "password");
    verify(generalSharedPreferences).reset(KEY_SERVER_URL);
}