@Test public void isFirstSpendOrder_True() throws InterruptedException { final CountDownLatch countDownLatch = new CountDownLatch(1); ArgumentCaptor<Callback<Boolean, Void>> isFirstSpendCallback = ArgumentCaptor.forClass(Callback.class); orderRepository.isFirstSpendOrder(new KinCallback<Boolean>() { @Override public void onResponse(Boolean response) { countDownLatch.countDown(); assertEquals(true, response); } @Override public void onFailure(KinEcosystemException exception) { } }); verify(local).isFirstSpendOrder(isFirstSpendCallback.capture()); isFirstSpendCallback.getValue().onResponse(true); countDownLatch.await(500, TimeUnit.MICROSECONDS); }
@Override public void isFirstSpendOrder(@NonNull final KinCallback<Boolean> callback) { localData.isFirstSpendOrder(new Callback<Boolean, Void>() { @Override public void onResponse(Boolean response) { callback.onResponse(response); } @Override public void onFailure(Void t) { callback .onFailure(getClientException(INTERNAL_INCONSISTENCY, new DataNotAvailableException())); } }); }
OrderRepository implements OrderDataSource { @Override public void isFirstSpendOrder(@NonNull final KinCallback<Boolean> callback) { localData.isFirstSpendOrder(new Callback<Boolean, Void>() { @Override public void onResponse(Boolean response) { callback.onResponse(response); } @Override public void onFailure(Void t) { callback .onFailure(getClientException(INTERNAL_INCONSISTENCY, new DataNotAvailableException())); } }); } }
OrderRepository implements OrderDataSource { @Override public void isFirstSpendOrder(@NonNull final KinCallback<Boolean> callback) { localData.isFirstSpendOrder(new Callback<Boolean, Void>() { @Override public void onResponse(Boolean response) { callback.onResponse(response); } @Override public void onFailure(Void t) { callback .onFailure(getClientException(INTERNAL_INCONSISTENCY, new DataNotAvailableException())); } }); } private  OrderRepository(@NonNull final BlockchainSource blockchainSource,
		@NonNull final EventLogger eventLogger,
		@NonNull final OrderDataSource.Remote remoteData,
		@NonNull final OrderDataSource.Local localData); }
OrderRepository implements OrderDataSource { @Override public void isFirstSpendOrder(@NonNull final KinCallback<Boolean> callback) { localData.isFirstSpendOrder(new Callback<Boolean, Void>() { @Override public void onResponse(Boolean response) { callback.onResponse(response); } @Override public void onFailure(Void t) { callback .onFailure(getClientException(INTERNAL_INCONSISTENCY, new DataNotAvailableException())); } }); } private  OrderRepository(@NonNull final BlockchainSource blockchainSource,
		@NonNull final EventLogger eventLogger,
		@NonNull final OrderDataSource.Remote remoteData,
		@NonNull final OrderDataSource.Local localData); static void init(@NonNull final BlockchainSource blockchainSource,
		@NonNull final EventLogger eventLogger,
		@NonNull final OrderDataSource.Remote remoteData,
		@NonNull final OrderDataSource.Local localData); static OrderRepository getInstance(); OrderList getAllCachedOrderHistory(); @Override void getAllOrderHistory(@NonNull final KinCallback<OrderList> callback); ObservableData<OpenOrder> getOpenOrder(); @Override void createOrder(@NonNull final String offerID, @Nullable final KinCallback<OpenOrder> callback); @Override void submitOrder(final OpenOrder order, @Nullable String content,
		kin.devplatform.network.model.Origin origin, @Nullable final KinCallback<Order> callback); @Override void cancelOrder(@NonNull final String offerID, @NonNull final String orderID,
		@Nullable final KinCallback<Void> callback); @Override void payToUser(String offerJwt, @Nullable final KinCallback<OrderConfirmation> callback); @Override void purchase(String offerJwt, @Nullable final KinCallback<OrderConfirmation> callback); @Override void requestPayment(String offerJwt, final KinCallback<OrderConfirmation> callback); @Override void addOrderObserver(@NonNull Observer<Order> observer); @Override void removeOrderObserver(@NonNull Observer<Order> observer); @Override void isFirstSpendOrder(@NonNull final KinCallback<Boolean> callback); @Override void setIsFirstSpendOrder(boolean isFirstSpendOrder); @Override void getExternalOrderStatus(@NonNull String offerID,
		@NonNull final KinCallback<OrderConfirmation> callback); }
OrderRepository implements OrderDataSource { @Override public void isFirstSpendOrder(@NonNull final KinCallback<Boolean> callback) { localData.isFirstSpendOrder(new Callback<Boolean, Void>() { @Override public void onResponse(Boolean response) { callback.onResponse(response); } @Override public void onFailure(Void t) { callback .onFailure(getClientException(INTERNAL_INCONSISTENCY, new DataNotAvailableException())); } }); } private  OrderRepository(@NonNull final BlockchainSource blockchainSource,
		@NonNull final EventLogger eventLogger,
		@NonNull final OrderDataSource.Remote remoteData,
		@NonNull final OrderDataSource.Local localData); static void init(@NonNull final BlockchainSource blockchainSource,
		@NonNull final EventLogger eventLogger,
		@NonNull final OrderDataSource.Remote remoteData,
		@NonNull final OrderDataSource.Local localData); static OrderRepository getInstance(); OrderList getAllCachedOrderHistory(); @Override void getAllOrderHistory(@NonNull final KinCallback<OrderList> callback); ObservableData<OpenOrder> getOpenOrder(); @Override void createOrder(@NonNull final String offerID, @Nullable final KinCallback<OpenOrder> callback); @Override void submitOrder(final OpenOrder order, @Nullable String content,
		kin.devplatform.network.model.Origin origin, @Nullable final KinCallback<Order> callback); @Override void cancelOrder(@NonNull final String offerID, @NonNull final String orderID,
		@Nullable final KinCallback<Void> callback); @Override void payToUser(String offerJwt, @Nullable final KinCallback<OrderConfirmation> callback); @Override void purchase(String offerJwt, @Nullable final KinCallback<OrderConfirmation> callback); @Override void requestPayment(String offerJwt, final KinCallback<OrderConfirmation> callback); @Override void addOrderObserver(@NonNull Observer<Order> observer); @Override void removeOrderObserver(@NonNull Observer<Order> observer); @Override void isFirstSpendOrder(@NonNull final KinCallback<Boolean> callback); @Override void setIsFirstSpendOrder(boolean isFirstSpendOrder); @Override void getExternalOrderStatus(@NonNull String offerID,
		@NonNull final KinCallback<OrderConfirmation> callback);  }