22
33import static org .junit .Assert .*;
44
5- import static org .mockito .ArgumentMatchers .any ;
65import static redis .clients .jedis .Protocol .Command .INCR ;
76import static redis .clients .jedis .Protocol .Command .GET ;
87import static redis .clients .jedis .Protocol .Command .SET ;
1514import org .junit .After ;
1615import org .junit .Before ;
1716import org .junit .Test ;
17+ import org .mockito .ArgumentMatchers ;
1818import org .mockito .MockedStatic ;
1919import org .mockito .Mockito ;
2020
@@ -159,7 +159,9 @@ public void discardFail() {
159159 trans .set ("b" , "b" );
160160
161161 try (MockedStatic <Protocol > protocol = Mockito .mockStatic (Protocol .class )) {
162- protocol .when (() -> Protocol .read (any ())).thenThrow (JedisConnectionException .class );
162+ //protocol.when(() -> Protocol.read(any())).thenThrow(JedisConnectionException.class);
163+ protocol .when (() -> Protocol .read (ArgumentMatchers .any (), ArgumentMatchers .isNull ()))
164+ .thenThrow (JedisConnectionException .class );
163165
164166 trans .discard ();
165167 fail ("Should get mocked JedisConnectionException." );
@@ -179,7 +181,9 @@ public void execFail() {
179181 trans .set ("b" , "b" );
180182
181183 try (MockedStatic <Protocol > protocol = Mockito .mockStatic (Protocol .class )) {
182- protocol .when (() -> Protocol .read (any ())).thenThrow (JedisConnectionException .class );
184+ //protocol.when(() -> Protocol.read(any())).thenThrow(JedisConnectionException.class);
185+ protocol .when (() -> Protocol .read (ArgumentMatchers .any (), ArgumentMatchers .isNull ()))
186+ .thenThrow (JedisConnectionException .class );
183187
184188 trans .exec ();
185189 fail ("Should get mocked JedisConnectionException." );
0 commit comments