fix tests (#717)

This commit is contained in:
m2049r 2021-02-19 17:25:11 +01:00 committed by GitHub
parent b04aa24269
commit e56369b91a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -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;
@ -61,11 +62,13 @@ public class SideShiftApiCreateOrderTest {
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
@ -112,7 +115,6 @@ public class SideShiftApiCreateOrderTest {
MockResponse jsonMockResponse = new MockResponse().setBody(
createMockCreateOrderResponse(btcAmount, btcAddress, xmrAmount, quoteId, orderId));
mockWebServer.enqueue(jsonMockResponse);
xmrToApi.createOrder(quoteId, btcAddress, new ShiftCallback<CreateOrder>() {
@Override
public void onSuccess(final CreateOrder order) {

View File

@ -22,6 +22,7 @@ import com.m2049r.xmrwallet.service.shift.ShiftException;
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;
@ -62,11 +63,13 @@ public class SideShiftApiRequestQuoteTest {
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