mirror of https://github.com/m2049r/xmrwallet.git
fix tests (#717)
This commit is contained in:
parent
b04aa24269
commit
e56369b91a
|
@ -16,11 +16,12 @@
|
||||||
|
|
||||||
package com.m2049r.xmrwallet.service.shift.sideshift;
|
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.ShiftException;
|
||||||
import com.m2049r.xmrwallet.service.shift.sideshift.api.CreateOrder;
|
import com.m2049r.xmrwallet.service.shift.sideshift.api.CreateOrder;
|
||||||
import com.m2049r.xmrwallet.service.shift.sideshift.api.SideShiftApi;
|
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.service.shift.sideshift.network.SideShiftApiImpl;
|
||||||
|
import com.m2049r.xmrwallet.util.ServiceHelper;
|
||||||
|
|
||||||
import net.jodah.concurrentunit.Waiter;
|
import net.jodah.concurrentunit.Waiter;
|
||||||
|
|
||||||
|
@ -61,11 +62,13 @@ public class SideShiftApiCreateOrderTest {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
|
|
||||||
xmrToApi = new SideShiftApiImpl(okHttpClient, mockWebServer.url("/"));
|
xmrToApi = new SideShiftApiImpl(okHttpClient, mockWebServer.url("/"));
|
||||||
|
ServiceHelper.ASSET="btc"; // all tests run with BTC
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
mockWebServer.shutdown();
|
mockWebServer.shutdown();
|
||||||
|
ServiceHelper.ASSET = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -110,9 +113,8 @@ public class SideShiftApiCreateOrderTest {
|
||||||
final String quoteId = "01234567-89ab-cdef-0123-456789abcdef";
|
final String quoteId = "01234567-89ab-cdef-0123-456789abcdef";
|
||||||
final String orderId = "09090909090909090911";
|
final String orderId = "09090909090909090911";
|
||||||
MockResponse jsonMockResponse = new MockResponse().setBody(
|
MockResponse jsonMockResponse = new MockResponse().setBody(
|
||||||
createMockCreateOrderResponse(btcAmount,btcAddress, xmrAmount, quoteId, orderId));
|
createMockCreateOrderResponse(btcAmount, btcAddress, xmrAmount, quoteId, orderId));
|
||||||
mockWebServer.enqueue(jsonMockResponse);
|
mockWebServer.enqueue(jsonMockResponse);
|
||||||
|
|
||||||
xmrToApi.createOrder(quoteId, btcAddress, new ShiftCallback<CreateOrder>() {
|
xmrToApi.createOrder(quoteId, btcAddress, new ShiftCallback<CreateOrder>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(final CreateOrder order) {
|
public void onSuccess(final CreateOrder order) {
|
||||||
|
|
|
@ -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.RequestQuote;
|
||||||
import com.m2049r.xmrwallet.service.shift.sideshift.api.SideShiftApi;
|
import com.m2049r.xmrwallet.service.shift.sideshift.api.SideShiftApi;
|
||||||
import com.m2049r.xmrwallet.service.shift.sideshift.network.SideShiftApiImpl;
|
import com.m2049r.xmrwallet.service.shift.sideshift.network.SideShiftApiImpl;
|
||||||
|
import com.m2049r.xmrwallet.util.ServiceHelper;
|
||||||
|
|
||||||
import net.jodah.concurrentunit.Waiter;
|
import net.jodah.concurrentunit.Waiter;
|
||||||
|
|
||||||
|
@ -62,11 +63,13 @@ public class SideShiftApiRequestQuoteTest {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
|
|
||||||
xmrToApi = new SideShiftApiImpl(okHttpClient, mockWebServer.url("/"));
|
xmrToApi = new SideShiftApiImpl(okHttpClient, mockWebServer.url("/"));
|
||||||
|
ServiceHelper.ASSET="btc"; // all tests run with BTC
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
@After
|
||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
mockWebServer.shutdown();
|
mockWebServer.shutdown();
|
||||||
|
ServiceHelper.ASSET = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue