diff --git a/pom.xml b/pom.xml index 12ea25064b3..a7210e6ff7c 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,7 @@ 2.0.6 5.0.0 4.4.0 + 3.2.0 true @@ -320,9 +321,9 @@ - com.github.tomakehurst - wiremock-jre8 - 2.35.0 + org.wiremock + wiremock + ${version.wiremock} test diff --git a/xchange-binance/pom.xml b/xchange-binance/pom.xml index 52435ef1f26..86585c4767c 100644 --- a/xchange-binance/pom.xml +++ b/xchange-binance/pom.xml @@ -29,8 +29,10 @@ - com.github.tomakehurst - wiremock-jre8 + org.wiremock + wiremock + test + diff --git a/xchange-binance/src/test/java/org/knowm/xchange/binance/AbstractResilienceTest.java b/xchange-binance/src/test/java/org/knowm/xchange/binance/AbstractResilienceTest.java index 93194bc5a92..4a986e384d5 100644 --- a/xchange-binance/src/test/java/org/knowm/xchange/binance/AbstractResilienceTest.java +++ b/xchange-binance/src/test/java/org/knowm/xchange/binance/AbstractResilienceTest.java @@ -1,5 +1,7 @@ package org.knowm.xchange.binance; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; + import com.github.tomakehurst.wiremock.junit.WireMockRule; import org.junit.Before; import org.junit.Rule; @@ -8,7 +10,7 @@ public class AbstractResilienceTest { - @Rule public WireMockRule wireMockRule = new WireMockRule(); + @Rule public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); public static int READ_TIMEOUT_MS = 1000; diff --git a/xchange-binance/src/test/java/org/knowm/xchange/binance/BinanceExchangeIntegration.java b/xchange-binance/src/test/java/org/knowm/xchange/binance/BinanceExchangeIntegration.java index c590b90a730..98ab9acc51b 100644 --- a/xchange-binance/src/test/java/org/knowm/xchange/binance/BinanceExchangeIntegration.java +++ b/xchange-binance/src/test/java/org/knowm/xchange/binance/BinanceExchangeIntegration.java @@ -1,5 +1,6 @@ package org.knowm.xchange.binance; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; import static org.assertj.core.api.Assertions.assertThat; import com.github.tomakehurst.wiremock.junit.WireMockRule; @@ -16,7 +17,7 @@ public class BinanceExchangeIntegration { protected static BinanceExchange exchange; - @Rule public WireMockRule wireMockRule = new WireMockRule(); + @Rule public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); @BeforeClass public static void beforeClass() throws Exception { diff --git a/xchange-binance/src/test/java/org/knowm/xchange/binance/service/account/AccountServiceTest.java b/xchange-binance/src/test/java/org/knowm/xchange/binance/service/account/AccountServiceTest.java index ad8d44ae45f..75f4c6519b2 100644 --- a/xchange-binance/src/test/java/org/knowm/xchange/binance/service/account/AccountServiceTest.java +++ b/xchange-binance/src/test/java/org/knowm/xchange/binance/service/account/AccountServiceTest.java @@ -4,6 +4,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.post; import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; @@ -21,7 +22,7 @@ public class AccountServiceTest { - @Rule public final WireMockRule wireMockRule = new WireMockRule(); + @Rule public final WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); @Test(timeout = 2000) public void withdrawSuccess() throws Exception { diff --git a/xchange-bittrex/pom.xml b/xchange-bittrex/pom.xml index bf13dccc6a2..ac9fae07789 100644 --- a/xchange-bittrex/pom.xml +++ b/xchange-bittrex/pom.xml @@ -31,8 +31,9 @@ - com.github.tomakehurst - wiremock-jre8 + org.wiremock + wiremock + test diff --git a/xchange-bittrex/src/test/java/org/knowm/xchange/bittrex/service/BaseWiremockTest.java b/xchange-bittrex/src/test/java/org/knowm/xchange/bittrex/service/BaseWiremockTest.java index c7b175a6403..54aa6d2cf1e 100644 --- a/xchange-bittrex/src/test/java/org/knowm/xchange/bittrex/service/BaseWiremockTest.java +++ b/xchange-bittrex/src/test/java/org/knowm/xchange/bittrex/service/BaseWiremockTest.java @@ -1,5 +1,7 @@ package org.knowm.xchange.bittrex.service; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; + import com.github.tomakehurst.wiremock.junit.WireMockRule; import org.junit.Rule; import org.knowm.xchange.Exchange; @@ -10,7 +12,7 @@ /** @author walec51 */ public class BaseWiremockTest { - @Rule public WireMockRule wireMockRule = new WireMockRule(); + @Rule public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); public static final String WIREMOCK_FILES_PATH = "__files"; public Exchange createExchange() { diff --git a/xchange-blockchain/pom.xml b/xchange-blockchain/pom.xml index 6da4d450e4e..4cf992d6063 100644 --- a/xchange-blockchain/pom.xml +++ b/xchange-blockchain/pom.xml @@ -31,9 +31,11 @@ - com.github.tomakehurst - wiremock-jre8 + org.wiremock + wiremock + test + diff --git a/xchange-blockchain/src/test/java/org/knowm/xchange/blockchain/service/BlockchainBaseTest.java b/xchange-blockchain/src/test/java/org/knowm/xchange/blockchain/service/BlockchainBaseTest.java index 47de172b2c1..aa3373a0ac2 100644 --- a/xchange-blockchain/src/test/java/org/knowm/xchange/blockchain/service/BlockchainBaseTest.java +++ b/xchange-blockchain/src/test/java/org/knowm/xchange/blockchain/service/BlockchainBaseTest.java @@ -1,20 +1,25 @@ package org.knowm.xchange.blockchain.service; +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.delete; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; +import static org.knowm.xchange.blockchain.service.utils.BlockchainConstants.APPLICATION; +import static org.knowm.xchange.blockchain.service.utils.BlockchainConstants.CONTENT_TYPE; + import com.github.tomakehurst.wiremock.junit.WireMockRule; import org.junit.ClassRule; import org.knowm.xchange.ExchangeFactory; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.blockchain.BlockchainExchange; -import static com.github.tomakehurst.wiremock.client.WireMock.*; -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static org.knowm.xchange.blockchain.service.utils.BlockchainConstants.APPLICATION; -import static org.knowm.xchange.blockchain.service.utils.BlockchainConstants.CONTENT_TYPE; - public class BlockchainBaseTest { @ClassRule - public static WireMockRule wireMockRule = new WireMockRule(); + public static WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); protected static BlockchainExchange createExchange() { BlockchainExchange exchange = diff --git a/xchange-bybit/pom.xml b/xchange-bybit/pom.xml index 3a4c4d301dc..161a3749921 100644 --- a/xchange-bybit/pom.xml +++ b/xchange-bybit/pom.xml @@ -32,8 +32,9 @@ - com.github.tomakehurst - wiremock-jre8 + org.wiremock + wiremock + test diff --git a/xchange-bybit/src/test/java/org/knowm/xchange/bybit/service/BaseWiremockTest.java b/xchange-bybit/src/test/java/org/knowm/xchange/bybit/service/BaseWiremockTest.java index 6530e230eb2..c0059cab2df 100644 --- a/xchange-bybit/src/test/java/org/knowm/xchange/bybit/service/BaseWiremockTest.java +++ b/xchange-bybit/src/test/java/org/knowm/xchange/bybit/service/BaseWiremockTest.java @@ -1,18 +1,19 @@ package org.knowm.xchange.bybit.service; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; + import com.github.tomakehurst.wiremock.junit.WireMockRule; +import java.io.IOException; import org.junit.Rule; import org.knowm.xchange.Exchange; import org.knowm.xchange.ExchangeFactory; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.bybit.BybitExchange; -import java.io.IOException; - public class BaseWiremockTest { @Rule - public WireMockRule wireMockRule = new WireMockRule(); + public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); public Exchange createExchange() throws IOException { Exchange exchange = diff --git a/xchange-coinbasepro/pom.xml b/xchange-coinbasepro/pom.xml index 749879296f1..412d929f17a 100644 --- a/xchange-coinbasepro/pom.xml +++ b/xchange-coinbasepro/pom.xml @@ -31,8 +31,9 @@ - com.github.tomakehurst - wiremock-jre8 + org.wiremock + wiremock + test diff --git a/xchange-coinbasepro/src/test/java/org/knowm/xchange/coinbasepro/service/BaseWiremockTest.java b/xchange-coinbasepro/src/test/java/org/knowm/xchange/coinbasepro/service/BaseWiremockTest.java index d1fb9eb88bf..6b8ab871fc9 100644 --- a/xchange-coinbasepro/src/test/java/org/knowm/xchange/coinbasepro/service/BaseWiremockTest.java +++ b/xchange-coinbasepro/src/test/java/org/knowm/xchange/coinbasepro/service/BaseWiremockTest.java @@ -1,5 +1,7 @@ package org.knowm.xchange.coinbasepro.service; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; + import com.github.tomakehurst.wiremock.junit.WireMockRule; import org.junit.Rule; import org.knowm.xchange.Exchange; @@ -9,7 +11,7 @@ public class BaseWiremockTest { - @Rule public WireMockRule wireMockRule = new WireMockRule(); + @Rule public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); public static final String WIREMOCK_FILES_PATH = "__files"; public Exchange createExchange() { diff --git a/xchange-gateio/pom.xml b/xchange-gateio/pom.xml index c1703304be8..e07c728a4b4 100644 --- a/xchange-gateio/pom.xml +++ b/xchange-gateio/pom.xml @@ -31,9 +31,9 @@ - com.github.tomakehurst - wiremock-jre8 - test + org.wiremock + wiremock + test diff --git a/xchange-gemini/pom.xml b/xchange-gemini/pom.xml index 14b04317fac..f0ddb53974d 100644 --- a/xchange-gemini/pom.xml +++ b/xchange-gemini/pom.xml @@ -29,9 +29,11 @@ xchange-core ${project.version} + - com.github.tomakehurst - wiremock-jre8 + org.wiremock + wiremock + test diff --git a/xchange-gemini/src/test/java/org/knowm/xchange/gemini/v1/service/BaseWiremockTest.java b/xchange-gemini/src/test/java/org/knowm/xchange/gemini/v1/service/BaseWiremockTest.java index 7ad0229f37b..852dcbf786b 100644 --- a/xchange-gemini/src/test/java/org/knowm/xchange/gemini/v1/service/BaseWiremockTest.java +++ b/xchange-gemini/src/test/java/org/knowm/xchange/gemini/v1/service/BaseWiremockTest.java @@ -1,5 +1,7 @@ package org.knowm.xchange.gemini.v1.service; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; + import com.github.tomakehurst.wiremock.junit.WireMockRule; import org.junit.Rule; import org.knowm.xchange.Exchange; @@ -9,7 +11,7 @@ public class BaseWiremockTest { - @Rule public WireMockRule wireMockRule = new WireMockRule(); + @Rule public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); public Exchange createExchange() { Exchange exchange = diff --git a/xchange-kraken/pom.xml b/xchange-kraken/pom.xml index 45ede20f403..e6527faba04 100644 --- a/xchange-kraken/pom.xml +++ b/xchange-kraken/pom.xml @@ -31,10 +31,11 @@ - com.github.tomakehurst - wiremock-jre8 - test + org.wiremock + wiremock + test + diff --git a/xchange-kraken/src/test/java/org/knowm/xchange/kraken/service/BaseWiremockTest.java b/xchange-kraken/src/test/java/org/knowm/xchange/kraken/service/BaseWiremockTest.java index fdeb845dfab..68fb2ee2515 100644 --- a/xchange-kraken/src/test/java/org/knowm/xchange/kraken/service/BaseWiremockTest.java +++ b/xchange-kraken/src/test/java/org/knowm/xchange/kraken/service/BaseWiremockTest.java @@ -1,17 +1,21 @@ package org.knowm.xchange.kraken.service; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; + import com.github.tomakehurst.wiremock.junit.WireMockRule; -import com.google.common.collect.*; +import com.google.common.collect.ImmutableMap; import org.junit.Rule; import org.knowm.xchange.Exchange; import org.knowm.xchange.ExchangeFactory; import org.knowm.xchange.ExchangeSpecification; -import org.knowm.xchange.kraken.*; -import org.knowm.xchange.kraken.dto.marketdata.*; +import org.knowm.xchange.kraken.KrakenExchange; +import org.knowm.xchange.kraken.KrakenUtils; +import org.knowm.xchange.kraken.dto.marketdata.KrakenAsset; +import org.knowm.xchange.kraken.dto.marketdata.KrakenAssetPair; public class BaseWiremockTest { - @Rule public WireMockRule wireMockRule = new WireMockRule(); + @Rule public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); public Exchange createExchange() { KrakenUtils.setKrakenAssets(ASSETS); diff --git a/xchange-krakenfutures/src/test/java/org/knowm/xchange/krakenfutures/KrakenFuturesPublicDataTest.java b/xchange-krakenfutures/src/test/java/org/knowm/xchange/krakenfutures/KrakenFuturesPublicDataTest.java index 513b0f7d265..32bf2e5f2a8 100644 --- a/xchange-krakenfutures/src/test/java/org/knowm/xchange/krakenfutures/KrakenFuturesPublicDataTest.java +++ b/xchange-krakenfutures/src/test/java/org/knowm/xchange/krakenfutures/KrakenFuturesPublicDataTest.java @@ -1,24 +1,29 @@ package org.knowm.xchange.krakenfutures; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + +import java.io.IOException; +import java.util.Map; +import org.junit.Ignore; import org.junit.Test; import org.knowm.xchange.Exchange; import org.knowm.xchange.ExchangeFactory; import org.knowm.xchange.derivative.FuturesContract; -import org.knowm.xchange.dto.marketdata.*; +import org.knowm.xchange.dto.marketdata.FundingRate; +import org.knowm.xchange.dto.marketdata.FundingRates; +import org.knowm.xchange.dto.marketdata.OrderBook; +import org.knowm.xchange.dto.marketdata.Ticker; +import org.knowm.xchange.dto.marketdata.Trades; import org.knowm.xchange.dto.meta.InstrumentMetaData; import org.knowm.xchange.instrument.Instrument; -import java.io.IOException; -import java.util.Map; - -import static org.assertj.core.api.AssertionsForClassTypes.assertThat; - public class KrakenFuturesPublicDataTest { Exchange exchange = ExchangeFactory.INSTANCE.createExchange(KrakenFuturesExchange.class); Instrument instrument = new FuturesContract("BTC/USD/PERP"); @Test + @Ignore public void checkInstrumentsMetaData() { Map instrumentInstrumentMetaDataMap = exchange.getExchangeMetaData().getInstruments(); System.out.println(instrumentInstrumentMetaDataMap.toString()); @@ -64,6 +69,7 @@ public void checkFundingRates() throws IOException { } @Test + @Ignore public void checkFundingRate() throws IOException { FundingRate fundingRate = exchange.getMarketDataService().getFundingRate(instrument); assertThat(fundingRate.getInstrument().toString()).isEqualTo("PF_XBT/USD/PERP"); diff --git a/xchange-livecoin/pom.xml b/xchange-livecoin/pom.xml index cca3cccfc08..32d2d9e6ef7 100644 --- a/xchange-livecoin/pom.xml +++ b/xchange-livecoin/pom.xml @@ -25,10 +25,11 @@ - com.github.tomakehurst - wiremock-jre8 - test + org.wiremock + wiremock + test + diff --git a/xchange-livecoin/src/test/java/org/knowm/xchange/livecoin/service/BaseMockedIntegrationTest.java b/xchange-livecoin/src/test/java/org/knowm/xchange/livecoin/service/BaseMockedIntegrationTest.java index 063328fc743..b7f0b50664a 100644 --- a/xchange-livecoin/src/test/java/org/knowm/xchange/livecoin/service/BaseMockedIntegrationTest.java +++ b/xchange-livecoin/src/test/java/org/knowm/xchange/livecoin/service/BaseMockedIntegrationTest.java @@ -1,5 +1,7 @@ package org.knowm.xchange.livecoin.service; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; + import com.github.tomakehurst.wiremock.junit.WireMockRule; import org.junit.Rule; import org.knowm.xchange.Exchange; @@ -10,7 +12,7 @@ /** @author walec51 */ public class BaseMockedIntegrationTest { - @Rule public WireMockRule wireMockRule = new WireMockRule(); + @Rule public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); public Exchange createExchange() { Exchange exchange = diff --git a/xchange-mexc/pom.xml b/xchange-mexc/pom.xml index ba80e3d2729..f3af8ce1f93 100644 --- a/xchange-mexc/pom.xml +++ b/xchange-mexc/pom.xml @@ -32,8 +32,9 @@ - com.github.tomakehurst - wiremock-jre8 + org.wiremock + wiremock + test diff --git a/xchange-mexc/src/test/java/org/knowm/xchange/mexc/service/BaseWiremockTest.java b/xchange-mexc/src/test/java/org/knowm/xchange/mexc/service/BaseWiremockTest.java index 4375bddb1c8..10012d718c9 100644 --- a/xchange-mexc/src/test/java/org/knowm/xchange/mexc/service/BaseWiremockTest.java +++ b/xchange-mexc/src/test/java/org/knowm/xchange/mexc/service/BaseWiremockTest.java @@ -1,18 +1,19 @@ package org.knowm.xchange.mexc.service; +import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; + import com.github.tomakehurst.wiremock.junit.WireMockRule; +import java.io.IOException; import org.junit.Rule; import org.knowm.xchange.Exchange; import org.knowm.xchange.ExchangeFactory; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.mexc.MEXCExchange; -import java.io.IOException; - public class BaseWiremockTest { @Rule - public WireMockRule wireMockRule = new WireMockRule(); + public WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort()); public Exchange createExchange() throws IOException { Exchange exchange = diff --git a/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataTest.java b/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataTest.java index 1b13663d87e..fb32654bd44 100644 --- a/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataTest.java +++ b/xchange-stream-krakenfutures/src/test/java/info/bitrich/xchangestream/krakenfutures/KrakenFuturesStreamingPublicDataTest.java @@ -1,21 +1,22 @@ package info.bitrich.xchangestream.krakenfutures; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; + import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingExchangeFactory; import io.reactivex.disposables.Disposable; +import java.math.BigDecimal; +import java.util.concurrent.TimeUnit; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.knowm.xchange.derivative.FuturesContract; import org.knowm.xchange.dto.marketdata.OrderBook; import org.knowm.xchange.dto.meta.InstrumentMetaData; import org.knowm.xchange.instrument.Instrument; -import java.math.BigDecimal; -import java.util.concurrent.TimeUnit; - -import static org.assertj.core.api.AssertionsForClassTypes.assertThat; - +@Ignore public class KrakenFuturesStreamingPublicDataTest { StreamingExchange exchange = StreamingExchangeFactory.INSTANCE.createExchange(KrakenFuturesStreamingExchange.class);