From e56369b91afd86c3361412d93ab480b3cac3715a Mon Sep 17 00:00:00 2001 From: m2049r Date: Fri, 19 Feb 2021 17:25:11 +0100 Subject: [PATCH] fix tests (#717) --- .../shift/sideshift/SideShiftApiCreateOrderTest.java | 8 +++++--- .../shift/sideshift/SideShiftApiRequestQuoteTest.java | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/test/java/com/m2049r/xmrwallet/service/shift/sideshift/SideShiftApiCreateOrderTest.java b/app/src/test/java/com/m2049r/xmrwallet/service/shift/sideshift/SideShiftApiCreateOrderTest.java index de3a6e2f..56150c3b 100644 --- a/app/src/test/java/com/m2049r/xmrwallet/service/shift/sideshift/SideShiftApiCreateOrderTest.java +++ b/app/src/test/java/com/m2049r/xmrwallet/service/shift/sideshift/SideShiftApiCreateOrderTest.java @@ -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 @@ -110,9 +113,8 @@ public class SideShiftApiCreateOrderTest { 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() { @Override public void onSuccess(final CreateOrder order) { diff --git a/app/src/test/java/com/m2049r/xmrwallet/service/shift/sideshift/SideShiftApiRequestQuoteTest.java b/app/src/test/java/com/m2049r/xmrwallet/service/shift/sideshift/SideShiftApiRequestQuoteTest.java index 0b4eae02..e6980a86 100644 --- a/app/src/test/java/com/m2049r/xmrwallet/service/shift/sideshift/SideShiftApiRequestQuoteTest.java +++ b/app/src/test/java/com/m2049r/xmrwallet/service/shift/sideshift/SideShiftApiRequestQuoteTest.java @@ -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