@@ -131,6 +131,18 @@ public abstract class AbstractConnectionIntegrationTests {
131131
132132 protected RedisConnection byteConnection ;
133133
134+ private boolean isJedisOrLettuceConnection (RedisConnectionFactory connectionFactory ) {
135+ return ConnectionUtils .isJedis (connectionFactory ) || ConnectionUtils .isLettuce (connectionFactory );
136+ }
137+
138+ private boolean isNotJedisOrLettuceConnection (RedisConnectionFactory connectionFactory ) {
139+ return !isJedisOrLettuceConnection (connectionFactory );
140+ }
141+
142+ private boolean isPipelinedOrQueueingConnection (RedisConnection connection ) {
143+ return connection .isPipelined () || connection .isQueueing ();
144+ }
145+
134146 @ BeforeEach
135147 public void setUp () {
136148
@@ -2595,12 +2607,12 @@ public void testListClientsContainsAtLeastOneElement() {
25952607 @ Test // DATAREDIS-290
25962608 void scanShouldReadEntireValueRange () {
25972609
2598- if (! ConnectionUtils . isJedis ( connectionFactory ) && ! ConnectionUtils . isLettuce (connectionFactory )) {
2610+ if (isNotJedisOrLettuceConnection (connectionFactory )) {
25992611 throw new AssumptionViolatedException ("SCAN is only available for jedis and lettuce" );
26002612 }
26012613
2602- if (connection . isPipelined () || connection . isQueueing ( )) {
2603- throw new AssumptionViolatedException ("SCAN is only available in non pipeline | queue mode" );
2614+ if (isPipelinedOrQueueingConnection ( connection )) {
2615+ throw new AssumptionViolatedException ("SCAN is only available in non- pipeline | non-queueing mode" );
26042616 }
26052617
26062618 connection .set ("spring" , "data" );
@@ -2626,8 +2638,9 @@ void scanShouldReadEntireValueRange() {
26262638 @ EnabledOnRedisVersion ("6.0" )
26272639 void scanWithType () {
26282640
2629- assumeThat (connection .isPipelined () || connection .isQueueing ())
2630- .describedAs ("SCAN is only available in non pipeline | queue mode" ).isFalse ();
2641+ assumeThat (isPipelinedOrQueueingConnection (connection ))
2642+ .describedAs ("SCAN is only available in non-pipeline | non-queueing mode" )
2643+ .isFalse ();
26312644
26322645 connection .set ("key" , "data" );
26332646 connection .lPush ("list" , "foo" );
@@ -2670,11 +2683,11 @@ public void scanShouldReadEntireValueRangeWhenIdividualScanIterationsReturnEmpty
26702683 @ Test // DATAREDIS-306
26712684 void zScanShouldReadEntireValueRange () {
26722685
2673- if (! ConnectionUtils . isJedis ( connectionFactory ) && ! ConnectionUtils . isLettuce (connectionFactory )) {
2686+ if (isNotJedisOrLettuceConnection (connectionFactory )) {
26742687 throw new AssumptionViolatedException ("ZSCAN is only available for jedis and lettuce" );
26752688 }
26762689
2677- if (connection . isPipelined () || connection . isQueueing ( )) {
2690+ if (isPipelinedOrQueueingConnection ( connection )) {
26782691 throw new AssumptionViolatedException ("ZSCAN is only available in non pipeline | queue mode" );
26792692 }
26802693
@@ -2701,11 +2714,11 @@ void zScanShouldReadEntireValueRange() {
27012714 @ Test // DATAREDIS-304
27022715 void sScanShouldReadEntireValueRange () {
27032716
2704- if (! ConnectionUtils . isJedis ( connectionFactory ) && ! ConnectionUtils . isLettuce (connectionFactory )) {
2717+ if (isNotJedisOrLettuceConnection (connectionFactory )) {
27052718 throw new AssumptionViolatedException ("SCAN is only available for jedis and lettuce" );
27062719 }
27072720
2708- if (connection . isPipelined () || connection . isQueueing ( )) {
2721+ if (isPipelinedOrQueueingConnection ( connection )) {
27092722 throw new AssumptionViolatedException ("SCAN is only available in non pipeline | queue mode" );
27102723 }
27112724
@@ -2726,11 +2739,11 @@ void sScanShouldReadEntireValueRange() {
27262739 @ Test // DATAREDIS-305
27272740 void hScanShouldReadEntireValueRange () {
27282741
2729- if (! ConnectionUtils . isJedis ( connectionFactory ) && ! ConnectionUtils . isLettuce (connectionFactory )) {
2742+ if (isNotJedisOrLettuceConnection (connectionFactory )) {
27302743 throw new AssumptionViolatedException ("HSCAN is only available for jedis and lettuce" );
27312744 }
27322745
2733- if (connection . isPipelined () || connection . isQueueing ( )) {
2746+ if (isPipelinedOrQueueingConnection ( connection )) {
27342747 throw new AssumptionViolatedException ("HSCAN is only available in non pipeline | queue mode" );
27352748 }
27362749
0 commit comments