Skip to content

Instantly share code, notes, and snippets.

@ThanawatMas
Last active December 2, 2018 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThanawatMas/90fbdd66a076bca5195acb8e3289dd0d to your computer and use it in GitHub Desktop.
Save ThanawatMas/90fbdd66a076bca5195acb8e3289dd0d to your computer and use it in GitHub Desktop.
public class LuckyCategory implements Api {
private String category;
private int entryNo;
private double discountRate;
public static Observable<Api> mockApi() {
LuckyCategory luckyCategory = new LuckyCategory();
luckyCategory.setCategory("Shoe");
luckyCategory.setEntryNo(25);
luckyCategory.setDiscountRate(10.5);
return Observable.just(luckyCategory);
}
public static Observable<Api> mockFailedApi() {
return Observable.fromCallable(() -> {
throw new RuntimeException("Unexpected Exception!!!! on LuckyCategory.mockFailedApi()");
});
}
@Override
public String getApiName() {
return getClass().getSimpleName();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment