@Test public void removeNativeOffer() throws Exception { NativeSpendOffer nativeOffer = new NativeSpendOffer("1") .title("Native offer title") .description("Native offer desc") .amount(1000) .image("Native offer image"); assertTrue(offerRepository.addNativeOffer(nativeOffer)); assertEquals(1, offerRepository.getCachedOfferList().getOffers().size()); assertEquals(nativeOffer, offerRepository.getCachedOfferList().getOffers().get(0)); assertTrue(offerRepository.removeNativeOffer(nativeOffer)); assertEquals(0, offerRepository.getCachedOfferList().getOffers().size()); assertFalse(offerRepository.removeNativeOffer(nativeOffer)); }
@Override public boolean removeNativeOffer(@NonNull NativeOffer nativeOffer) { return nativeOfferList.remove(nativeOffer); }
OfferRepository implements OfferDataSource { @Override public boolean removeNativeOffer(@NonNull NativeOffer nativeOffer) { return nativeOfferList.remove(nativeOffer); } }
OfferRepository implements OfferDataSource { @Override public boolean removeNativeOffer(@NonNull NativeOffer nativeOffer) { return nativeOfferList.remove(nativeOffer); } private  OfferRepository(@NonNull OfferDataSource.Remote remoteData, @NonNull OrderDataSource orderRepository); }
OfferRepository implements OfferDataSource { @Override public boolean removeNativeOffer(@NonNull NativeOffer nativeOffer) { return nativeOfferList.remove(nativeOffer); } private  OfferRepository(@NonNull OfferDataSource.Remote remoteData, @NonNull OrderDataSource orderRepository); static void init(@NonNull OfferDataSource.Remote remoteData, @NonNull OrderDataSource orderRepository); static OfferRepository getInstance(); @Override OfferList getCachedOfferList(); @Override void getOffers(@Nullable final KinCallback<OfferList> callback); @Override void addNativeOfferClickedObserver(@NonNull Observer<NativeSpendOffer> observer); @Override void removeNativeOfferClickedObserver(@NonNull Observer<NativeSpendOffer> observer); @Override ObservableData<NativeSpendOffer> getNativeSpendOfferObservable(); @Override boolean addNativeOffer(@NonNull NativeOffer nativeOffer); @Override boolean removeNativeOffer(@NonNull NativeOffer nativeOffer); }
OfferRepository implements OfferDataSource { @Override public boolean removeNativeOffer(@NonNull NativeOffer nativeOffer) { return nativeOfferList.remove(nativeOffer); } private  OfferRepository(@NonNull OfferDataSource.Remote remoteData, @NonNull OrderDataSource orderRepository); static void init(@NonNull OfferDataSource.Remote remoteData, @NonNull OrderDataSource orderRepository); static OfferRepository getInstance(); @Override OfferList getCachedOfferList(); @Override void getOffers(@Nullable final KinCallback<OfferList> callback); @Override void addNativeOfferClickedObserver(@NonNull Observer<NativeSpendOffer> observer); @Override void removeNativeOfferClickedObserver(@NonNull Observer<NativeSpendOffer> observer); @Override ObservableData<NativeSpendOffer> getNativeSpendOfferObservable(); @Override boolean addNativeOffer(@NonNull NativeOffer nativeOffer); @Override boolean removeNativeOffer(@NonNull NativeOffer nativeOffer);  }