BaseModel extends JSONObject implements Parcelable { public String getString(String key) { try { return super.getString(key); } catch (JSONException e) { Log.e(RapidFtrApplication.APP_IDENTIFIER, e.getMessage()); } return null; } BaseModel(String content);  BaseModel();  BaseModel(String id, String owner, String content); String getUniqueId(); String getInternalId(); void setUniqueId(String id); String getCreatedAt(); String getName(); void setName(String childName); String getLastUpdatedAt(); Long lastUpdatedAtInMillis(); void setLastUpdatedAt(String lastUpdatedAt); void generateUniqueId(); void setCreatedBy(String owner); String getJsonString(); boolean isNew(); @Override JSONArray names(); @Override int describeContents(); @Override void writeToParcel(Parcel parcel, int flags); void removeFromJSONArray(String key, String value); JSONObject values(); String getCreatedBy(); @Override JSONObject put(String key, Object value); void addToJSONArray(String key, Object element); String getString(String key); String getString(String key, String defaultValue); void setOrganisation(String userOrg); void setSynced(boolean synced); boolean isSynced(); String getShortId(); List<BaseModel> getPotentialMatchingModels(PotentialMatchRepository potentialMatchRepo, ChildRepository childRepo, EnquiryRepository enquiryRepository); String getApiPath(); String getApiParameter(); @Override boolean equals(Object other); List<BaseModel> getConfirmedMatchingModels(PotentialMatchRepository potentialMatchRepository, ChildRepository childRepository, EnquiryRepository enquiryRepository); void addHistory(History history); void setLastSyncedAt(String lastSyncedAt); String getLastSyncedAt(); String getSyncLog(); void setSyncLog(String syncLog1); String getRecordedAudio(); void putRecordedAudio(String fileName); static final ObjectMapper JSON_MAPPER; static final String FIELD_INTERNAL_ID; static final String FIELD_REVISION_ID; static final String EMPTY_STRING; }
@Test public void shouldDecodeString() throws JSONException { BaseModel child = new BaseModel("{ 'test1' : 'value1' }"); assertThat(child.getString("test1"), is("value1")); }