HaloContentInstance implements Parcelable { @Override public String toString() { String tags = mTags != null ? mTags.toString() : null; return "ContentInstance{" + "mItemId='" + mItemId + '\'' + ", mModuleName='" + mModuleName + '\'' + ", mModuleId='" + mModuleId + '\'' + ", mName='" + mName + '\'' + ", mValues=" + mValues + ", mAuthor='" + mAuthor + '\'' + ", mTags=" + tags + ", mCreatedDate=" + mCreatedDate + ", mArchivedAt=" + mArchived + ", mLastUpdate=" + mLastUpdate + ", mPublishedAt=" + mPublishedAt + ", mRemovedAt=" + mRemovedAt + '}'; } HaloContentInstance(); @Keep @Api(2.2)  HaloContentInstance(@Nullable String itemId,@Nullable String moduleName,@Nullable String moduleId,
                               @Nullable String name, @Nullable JSONObject values,
                               @Nullable String author, @Nullable Date archivedDate,@Nullable Date createdDate,
                               @Nullable Date updateDate, @Nullable Date publicationDate, @Nullable Date deletionDate,
                               @Nullable List<HaloSegmentationTag> tags); protected  HaloContentInstance(Parcel in); private  HaloContentInstance(@NonNull HaloContentInstance.Builder builder); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); @Keep @Api(2.2) @Nullable String getModuleName(); @Keep @Api(2.0) String getModuleId(); @Keep @Api(2.0) String getItemId(); @Keep @Api(2.0) String getName(); @Keep @Api(2.0) @Nullable JSONObject getValues(); @Keep @Api(2.0) String getAuthor(); @Keep @Api(2.2) List<HaloSegmentationTag> getTags(); @Keep @Api(2.2) @Nullable Date getArchivedDate(); @Keep @Api(2.0) @Nullable Date getCreatedDate(); @Keep @Api(2.0) @Nullable Date getLastUpdate(); @Keep @Api(2.0) @Nullable Date getPublishedDate(); @Keep @Api(2.0) @Nullable Date getRemoveDate(); @Override String toString(); static String serialize(@NonNull HaloContentInstance haloContentInstance, @NonNull Parser.Factory parser); @Nullable static HaloContentInstance deserialize(@Nullable String haloContentInstance, @NonNull Parser.Factory parser); static final Creator<HaloContentInstance> CREATOR; }
@Test public void thatConvertObjectToString() throws JSONException { Date now = new Date(); JSONObject json = new JSONObject("{foo: 'bar'}"); HaloContentInstance instance = new HaloContentInstance("fakeId", "fakeModuleName", "fakeModule", "fakeName", json,"fakeAuthor",now, now, now, now, now,new ArrayList<HaloSegmentationTag>()); assertThat(instance.toString()).isNotNull(); }