Skip to content

Commit be1663c

Browse files
committed
Adopt to Mockito changes.
Closes #2221
1 parent ca7b004 commit be1663c

File tree

6 files changed

+11
-16
lines changed

6 files changed

+11
-16
lines changed

src/test/java/org/springframework/data/redis/connection/jedis/JedisClusterConnectionUnitTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void clusterReplicateShouldSendCommandsCorrectly() {
147147
verify(con2Mock, times(1)).clusterReplicate(CLUSTER_NODE_1.getId());
148148
verify(con1Mock, atMost(1)).clusterNodes();
149149
verify(con1Mock, atMost(1)).close();
150-
verifyZeroInteractions(con1Mock);
150+
verifyNoMoreInteractions(con1Mock);
151151
}
152152

153153
@Test // DATAREDIS-315
@@ -232,7 +232,7 @@ void clusterDeleteSlotsShouldBeExecutedCorrectly() {
232232
int[] slots = new int[] { 9000, 10000 };
233233
connection.clusterDeleteSlots(CLUSTER_NODE_2, slots);
234234

235-
verify(con2Mock, times(1)).clusterDelSlots((int[]) anyVararg());
235+
verify(con2Mock, times(1)).clusterDelSlots((int[]) any());
236236
}
237237

238238
@Test // DATAREDIS-315

src/test/java/org/springframework/data/redis/connection/lettuce/LettuceClusterConnectionUnitTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void clusterForgetShouldSendCommandsToRemainingNodesCorrectly() {
163163
connection.clusterForget(CLUSTER_NODE_2);
164164

165165
verify(clusterConnection1Mock, times(1)).clusterForget(CLUSTER_NODE_2.getId());
166-
verifyZeroInteractions(clusterConnection2Mock);
166+
verifyNoInteractions(clusterConnection2Mock);
167167
verify(clusterConnection3Mock, times(1)).clusterForget(CLUSTER_NODE_2.getId());
168168
}
169169

@@ -173,7 +173,7 @@ void clusterReplicateShouldSendCommandsCorrectly() {
173173
connection.clusterReplicate(CLUSTER_NODE_1, CLUSTER_NODE_2);
174174

175175
verify(clusterConnection2Mock, times(1)).clusterReplicate(CLUSTER_NODE_1.getId());
176-
verifyZeroInteractions(clusterConnection1Mock);
176+
verifyNoInteractions(clusterConnection1Mock);
177177
}
178178

179179
@Test // DATAREDIS-315
@@ -334,7 +334,7 @@ void timeShouldBeExecutedOnSingleNode() {
334334
connection.time(CLUSTER_NODE_2);
335335

336336
verify(clusterConnection2Mock, times(1)).time();
337-
verifyZeroInteractions(clusterConnection1Mock, clusterConnection3Mock);
337+
verifyNoInteractions(clusterConnection1Mock, clusterConnection3Mock);
338338
}
339339

340340
@Test // DATAREDIS-315
@@ -412,6 +412,6 @@ void shouldExecuteOnDedicatedConnection() {
412412
verify(async).blpop(1, KEY_1_BYTES);
413413
verify(connectionProviderMock).getConnection(StatefulConnection.class);
414414
verifyNoMoreInteractions(connectionProviderMock);
415-
verifyZeroInteractions(sharedConnectionMock);
415+
verifyNoInteractions(sharedConnectionMock);
416416
}
417417
}

src/test/java/org/springframework/data/redis/connection/lettuce/LettucePoolingConnectionProviderUnitTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void shouldReturnConnectionOnRelease() {
5757

5858
provider.release(provider.getConnection(StatefulRedisConnection.class));
5959

60-
verifyZeroInteractions(commandsMock);
60+
verifyNoInteractions(commandsMock);
6161
}
6262

6363
@Test // DATAREDIS-988

src/test/java/org/springframework/data/redis/connection/lettuce/LettuceReactiveRedisConnectionUnitTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ void shouldLazilyInitializeConnection() {
7272

7373
new LettuceReactiveRedisConnection(connectionProvider);
7474

75-
verifyZeroInteractions(connectionProvider);
75+
verifyNoInteractions(connectionProvider);
7676
}
7777

7878
@Test // DATAREDIS-720, DATAREDIS-721
@@ -103,7 +103,7 @@ void shouldExecuteOnSharedConnection() {
103103

104104
connection.execute(cmd -> Mono.just("foo")).as(StepVerifier::create).expectNext("foo").verifyComplete();
105105

106-
verifyZeroInteractions(connectionProvider);
106+
verifyNoInteractions(connectionProvider);
107107
}
108108

109109
@Test // DATAREDIS-720, DATAREDIS-721

src/test/java/org/springframework/data/redis/core/ConnectionSplittingInterceptorUnitTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ void interceptorShouldRequestFreshConnectionForReadonlyCommand() throws Throwabl
7171

7272
interceptor.intercept(boundConnectionMock, READONLY_METHOD, new Object[] { new byte[] {} });
7373
verify(connectionFactoryMock, times(1)).getConnection();
74-
verifyZeroInteractions(boundConnectionMock);
74+
verifyNoInteractions(boundConnectionMock);
7575
}
7676

7777
@Test // DATAREDIS-73
7878
void interceptorShouldUseBoundConnectionForWriteOperations() throws Throwable {
7979

8080
interceptor.intercept(boundConnectionMock, WRITE_METHOD, new Object[] { new byte[] {}, 0L });
8181
verify(boundConnectionMock, times(1)).expire(any(byte[].class), anyLong());
82-
verifyZeroInteractions(connectionFactoryMock);
82+
verifyNoInteractions(connectionFactoryMock);
8383
}
8484

8585
@SuppressWarnings("unchecked")

src/test/java/org/springframework/data/redis/test/util/MockitoUtils.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@ public MatchableInvocation getTarget() {
9999
return wanted;
100100
}
101101

102-
@Override
103-
public InvocationMatcher getWanted() {
104-
return wanted;
105-
}
106-
107102
}
108103

109104
}

0 commit comments

Comments
 (0)