Last active
December 2, 2018 17:19
-
-
Save ThanawatMas/90fbdd66a076bca5195acb8e3289dd0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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