Skip to content

Commit

Permalink
Merge pull request #4872 from bigscoop/update-mockito
Browse files Browse the repository at this point in the history
[general] Update mockito
  • Loading branch information
timmolter authored May 7, 2024
2 parents f9f9052 + 46e5641 commit ad1b2fd
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 32 deletions.
10 changes: 9 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<version.commons.lang3>3.14.0</version.commons.lang3>
<version.fasterxml>2.14.3</version.fasterxml>
<version.github.mmazi>3.0</version.github.mmazi>
<version.mockito>5.11.0</version.mockito>
<version.resilience4j>1.7.1</version.resilience4j>
<version.junit>5.10.2</version.junit>
<version.lombok>1.18.32</version.lombok>
Expand Down Expand Up @@ -320,7 +321,14 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.12.4</version>
<version>${version.mockito}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${version.mockito}</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
Expand All @@ -27,7 +27,7 @@
import org.knowm.xchange.dto.meta.InstrumentMetaData;
import org.knowm.xchange.instrument.Instrument;
import org.knowm.xchange.utils.nonce.AtomicLongIncrementalTime2013NonceFactory;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import si.mazi.rescu.ClientConfig;
import si.mazi.rescu.IRestProxyFactory;
import si.mazi.rescu.SynchronizedValueFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand All @@ -29,7 +29,7 @@
import org.knowm.xchange.dto.account.Balance;
import org.knowm.xchange.exceptions.ExchangeException;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import si.mazi.rescu.ClientConfig;
import si.mazi.rescu.IRestProxyFactory;
import si.mazi.rescu.ParamsDigest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import si.mazi.rescu.RequestWriterResolver;
import si.mazi.rescu.RestInvocation;
import si.mazi.rescu.RestMethodMetadata;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -37,7 +37,7 @@
import org.knowm.xchange.dto.trade.LimitOrder;
import org.knowm.xchange.exceptions.ExchangeException;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import si.mazi.rescu.ClientConfig;
import si.mazi.rescu.IRestProxyFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.knowm.xchange.bleutrade.BleutradeAssert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -38,7 +38,7 @@
import org.knowm.xchange.exceptions.NotAvailableFromExchangeException;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import si.mazi.rescu.ClientConfig;
import si.mazi.rescu.IRestProxyFactory;
import si.mazi.rescu.ParamsDigest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.knowm.xchange.btcmarkets.service;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;

import java.io.IOException;
Expand All @@ -23,7 +24,6 @@
import org.knowm.xchange.dto.Order;
import org.knowm.xchange.dto.trade.LimitOrder;
import org.knowm.xchange.dto.trade.MarketOrder;
import org.mockito.Matchers;
import org.mockito.Mockito;
import si.mazi.rescu.SynchronizedValueFactory;

Expand All @@ -43,7 +43,7 @@ public void shouldPlaceMarketOrder() throws IOException {
BTCMarketsPlaceOrderResponse orderResponse = new BTCMarketsPlaceOrderResponse("11111");

when(btcMarketsAuthenticatedV3.placeOrder(
Mockito.eq(SPECIFICATION_API_KEY),
eq(SPECIFICATION_API_KEY),
Mockito.any(SynchronizedValueFactory.class),
Mockito.any(BTCMarketsDigestV3.class),
Mockito.refEq(btcMarketsOrder)))
Expand Down Expand Up @@ -84,7 +84,7 @@ public void shouldPlaceLimitOrder() throws IOException {
BTCMarketsPlaceOrderResponse orderResponse = new BTCMarketsPlaceOrderResponse("11111");

when(btcMarketsAuthenticatedV3.placeOrder(
Mockito.eq(SPECIFICATION_API_KEY),
eq(SPECIFICATION_API_KEY),
Mockito.any(SynchronizedValueFactory.class),
Mockito.any(BTCMarketsDigestV3.class),
Mockito.refEq(expectedRequest)))
Expand Down Expand Up @@ -126,7 +126,7 @@ public void shouldPlaceLimitOrderWithUserReference() throws IOException {
BTCMarketsPlaceOrderResponse orderResponse = new BTCMarketsPlaceOrderResponse("11111");

when(btcMarketsAuthenticatedV3.placeOrder(
Mockito.eq(SPECIFICATION_API_KEY),
eq(SPECIFICATION_API_KEY),
Mockito.any(SynchronizedValueFactory.class),
Mockito.any(BTCMarketsDigestV3.class),
Mockito.refEq(expectedRequest)))
Expand Down Expand Up @@ -168,7 +168,7 @@ public void shouldPlaceLimitOrderWithPostOnlyFlag() throws IOException {
BTCMarketsPlaceOrderResponse orderResponse = new BTCMarketsPlaceOrderResponse("11111");

when(btcMarketsAuthenticatedV3.placeOrder(
Mockito.eq(SPECIFICATION_API_KEY),
eq(SPECIFICATION_API_KEY),
Mockito.any(SynchronizedValueFactory.class),
Mockito.any(BTCMarketsDigestV3.class),
Mockito.refEq(expectedRequest)))
Expand All @@ -194,7 +194,7 @@ public void shouldCancelOrder() throws IOException {
Arrays.asList(new BTCMarketsException(true, null, 0, "12345", 111L, null)));

when(btcMarketsAuthenticated.cancelOrder(
Mockito.eq(SPECIFICATION_API_KEY),
eq(SPECIFICATION_API_KEY),
Mockito.any(SynchronizedValueFactory.class),
Mockito.any(BTCMarketsDigest.class),
Mockito.refEq(cancelOrderRequest)))
Expand Down Expand Up @@ -227,10 +227,10 @@ public void shouldGetOrderDetails() throws IOException {
BTCMarketsOrders btcMarketsOrders = new BTCMarketsOrders(true, "", 0, new ArrayList<>());

when(btcMarketsAuthenticated.getOrderDetails(
Mockito.eq(SPECIFICATION_API_KEY),
eq(SPECIFICATION_API_KEY),
Mockito.any(SynchronizedValueFactory.class),
Mockito.any(BTCMarketsDigest.class),
Matchers.eq(btcMarketsOrderDetailsRequest)))
eq(btcMarketsOrderDetailsRequest)))
.thenReturn(btcMarketsOrders);
// when
Collection<Order> orders = btcMarketsTradeService.getOrder("1000");
Expand Down
5 changes: 0 additions & 5 deletions xchange-gateio-v4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<name>XChange Gate.io V4</name>
<description>XChange implementation for the Gate.io Exchange</description>

<properties>
<version.mockito>5.3.1</version.mockito>
</properties>

<dependencies>

<dependency>
Expand Down Expand Up @@ -53,7 +49,6 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${version.mockito}</version>
<scope>test</scope>
</dependency>

Expand Down
5 changes: 0 additions & 5 deletions xchange-stream-gateio/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

<name>XChange Gate.io Stream</name>

<properties>
<version.mockito>5.3.1</version.mockito>
</properties>

<dependencies>

<dependency>
Expand Down Expand Up @@ -44,7 +40,6 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>${version.mockito}</version>
<scope>test</scope>
</dependency>

Expand Down

0 comments on commit ad1b2fd

Please sign in to comment.