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
$.body.page_count -> Expected 1 but received 462 | |
$.body._embedded.product.0.name -> Expected 'Alaska Coat' but received '1460 8 Eye Boots Smooth' | |
$.body._embedded.product.0.sku -> Expected 'FR760AA31JSE' but received 'DR086SH49AVE' | |
$.body._embedded.product.0.price -> Expected 169.95 but received 199 | |
$.body._embedded.product.0.short_description -> Expected 'A product description' but received '<b>PLEASE NOTE - THE ICONIC IS UNABLE TO SHIP THIS PRODUCT TO NEW ZEALAND.</b><br><br>For the original grunge look, you can't go past <b>Dr Martens 1460Z DMC 8 Eye Lace Up</b> boots, a direct replica of the first boots to roll off the production | |
line in 1960. Combine your pair with distressed skinny jeans and a printed tee.<br><br>- Genuine leather upper and lining<br>- Rounded toe<br>- Eight-eye lace-up fastening<br>- Classic looped pull tab<br>- Topstitch detailing around the sole<br>- Oil and acid resistant outsole<br><br>PLEASE NOTE : This style comes in UK sizing and has a unisex fit. We reco |
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
pactBuilder { | |
serviceConsumer 'Android_App' | |
hasPactWith 'Eve_v1' | |
port PORT | |
uponReceiving 'A request for products' | |
withAttributes( | |
method: 'GET', | |
path: "/catalog/products", | |
headers: ['Accept': 'application/json'], |
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
{ | |
"description": "A request for products", | |
"request": { | |
"method": "GET", | |
"path": "/catalog/products", | |
"headers": { | |
"Accept": "application/json" | |
}, | |
"query": { | |
"gender": [ |
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
{ | |
"description": "A request for products", | |
"request": { | |
"method": "GET", | |
"path": "/catalog/products", | |
"headers": { | |
"Accept": "application/json" | |
}, | |
"query": "gender=male" | |
}, |
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 static <T> Observable.Transformer<T, T> doOnLast(Action1<T> doOnCompleteFunc) { | |
return new Observable.Transformer<T, T>() { | |
private T lastValue; | |
@Override | |
public Observable<T> call(Observable<T> observable) { | |
return observable.doOnNext(value -> { | |
lastValue = value; | |
}).doOnCompleted(() -> { | |
doOnCompleteFunc.call(lastValue); |
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 ReactiveData<T> { | |
@Getter | |
private final T value; | |
@Getter | |
private final Throwable error; | |
public ReactiveData(T value) { | |
this.value = value; |
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 static <T, R> Observable.Transformer<T, R> switchMapSwallowError(Func1<T, Observable<R>> onwardCall) { | |
return new Observable.Transformer<T, R>() { | |
private R previousValue = null; | |
@Override | |
public Observable<R> call(Observable<T> observable) { | |
return observable.switchMap( | |
a -> onwardCall.call(a) | |
.doOnNext(value -> previousValue = value) |
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 static Observable.Transformer<Integer, Integer> increment() { | |
return new Observable.Transformer<Integer, Integer>() { | |
private Integer previous = 0; | |
@Override | |
public Observable<Integer> call(Observable<Integer> integerObservable) { | |
return integerObservable.map(i -> { | |
Integer val = i + previous; | |
previous = val; | |
return val; |
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
1 * useCase.repository.removeItem(_) >> Observable.just(true) | |
1 * useCase.repository.removeItem(_ as String) >> Observable.just(true) | |
1 * useCase.repository.removeItem(simpleSku) >> { args-> | |
assert args[0] == simpleSku | |
return Observable.just(true) | |
} |
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
ArrayList<String> imageUrls = new ArrayList<>(); | |
imageUrls.add("http://theiconic.com.au/someImage.jpg") | |
imageUrls.add("http://theiconic.com.au/someOtherImage.jpg") | |
CatalogProductEntity product = mockProduct("sky", "name", "BrandName", 120d, 90d, imageUrls) |
NewerOlder