SearchSort implements Parcelable { @Keep @NonNull @Api(2.4) public String getSortQuery() { return sortQuery; } SearchSort(@NonNull @SortField.SortOperator String field, @NonNull @SortOrder.SortType String sortOrder); protected  SearchSort(Parcel in); @Override int describeContents(); @Override void writeToParcel(Parcel dest, int flags); @Keep @NonNull @Api(2.4) String getSortQuery(); static final Creator<SearchSort> CREATOR; }
@Test public void thatCanCreateASeatchSortInstance() { SearchSort instance = new SearchSort(SortField.DELETED, SortOrder.DESCENDING); String sort = instance.getSortQuery(); assertThat(sort).contains(SortField.DELETED); assertThat(sort).contains(SortOrder.DESCENDING); }
@Test public void thatAParcelOperationKeepsTheSameDataWithConstructor() { SearchSort instance = new SearchSort(SortField.DELETED, SortOrder.DESCENDING); SearchSort parcelInstance = TestUtils.testParcel(instance, SearchSort.CREATOR); assertThat(instance.getSortQuery()).isEqualTo(parcelInstance.getSortQuery()); }