Skip to content

Commit

Permalink
fix tests (#717)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2049r authored Feb 19, 2021
1 parent b04aa24 commit e56369b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@

package com.m2049r.xmrwallet.service.shift.sideshift;

import com.m2049r.xmrwallet.service.shift.ShiftCallback;
import com.m2049r.xmrwallet.service.shift.ShiftException;
import com.m2049r.xmrwallet.service.shift.sideshift.api.CreateOrder;
import com.m2049r.xmrwallet.service.shift.sideshift.api.SideShiftApi;
import com.m2049r.xmrwallet.service.shift.ShiftCallback;
import com.m2049r.xmrwallet.service.shift.sideshift.network.SideShiftApiImpl;
import com.m2049r.xmrwallet.util.ServiceHelper;

import net.jodah.concurrentunit.Waiter;

Expand Down Expand Up @@ -61,11 +62,13 @@ public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);

xmrToApi = new SideShiftApiImpl(okHttpClient, mockWebServer.url("/"));
ServiceHelper.ASSET="btc"; // all tests run with BTC
}

@After
public void tearDown() throws Exception {
mockWebServer.shutdown();
ServiceHelper.ASSET = null;
}

@Test
Expand Down Expand Up @@ -110,9 +113,8 @@ public void createOrder_wasSuccessfulShouldRespondWithOrder()
final String quoteId = "01234567-89ab-cdef-0123-456789abcdef";
final String orderId = "09090909090909090911";
MockResponse jsonMockResponse = new MockResponse().setBody(
createMockCreateOrderResponse(btcAmount,btcAddress, xmrAmount, quoteId, orderId));
createMockCreateOrderResponse(btcAmount, btcAddress, xmrAmount, quoteId, orderId));
mockWebServer.enqueue(jsonMockResponse);

xmrToApi.createOrder(quoteId, btcAddress, new ShiftCallback<CreateOrder>() {
@Override
public void onSuccess(final CreateOrder order) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.m2049r.xmrwallet.service.shift.sideshift.api.RequestQuote;
import com.m2049r.xmrwallet.service.shift.sideshift.api.SideShiftApi;
import com.m2049r.xmrwallet.service.shift.sideshift.network.SideShiftApiImpl;
import com.m2049r.xmrwallet.util.ServiceHelper;

import net.jodah.concurrentunit.Waiter;

Expand Down Expand Up @@ -62,11 +63,13 @@ public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);

xmrToApi = new SideShiftApiImpl(okHttpClient, mockWebServer.url("/"));
ServiceHelper.ASSET="btc"; // all tests run with BTC
}

@After
public void tearDown() throws Exception {
mockWebServer.shutdown();
ServiceHelper.ASSET = null;
}

@Test
Expand Down

0 comments on commit e56369b

Please sign in to comment.