File tree 2 files changed +10
-9
lines changed
main/java/org/springframework/data/redis/core
test/java/org/springframework/data/redis/core
2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -257,8 +257,8 @@ public static RedisCommand failsafeCommandLookup(String key) {
257
257
private final boolean read ;
258
258
private final boolean write ;
259
259
260
- final int minArgs ;
261
- final int maxArgs ;
260
+ private final int minArgs ;
261
+ private final int maxArgs ;
262
262
263
263
private final @ Nullable String alias ;
264
264
Original file line number Diff line number Diff line change 20
20
import java .util .Arrays ;
21
21
22
22
import org .junit .jupiter .api .Test ;
23
+ import org .springframework .test .util .ReflectionTestUtils ;
23
24
24
25
/**
25
26
* Unit tests for {@link RedisCommand}.
@@ -123,19 +124,19 @@ void isRepresentedByIsCorrectForAllCommandsAndTheirAliases() {
123
124
@ Test // GH-2646
124
125
void commandRequiresArgumentsIsCorrect () {
125
126
126
- Arrays .stream (RedisCommand .values ()). forEach ( command ->
127
- assertThat (command .requiresArguments ())
127
+ Arrays .stream (RedisCommand .values ())
128
+ . forEach ( command -> assertThat (command .requiresArguments ())
128
129
.describedAs ("Redis command [%s] failed required arguments check" , command )
129
- .isEqualTo (command . minArgs > 0 ));
130
+ .isEqualTo (( int ) ReflectionTestUtils . getField ( command , " minArgs" ) > 0 ));
130
131
}
131
132
132
133
@ Test // GH-2646
133
134
void commandRequiresExactNumberOfArgumentsIsCorrect () {
134
135
135
- Arrays .stream (RedisCommand .values ()). forEach ( command ->
136
- assertThat (command .requiresExactNumberOfArguments ())
137
- .describedAs ("Redis command [%s] failed requires exact arguments check" )
138
- . isEqualTo (command . minArgs == command . maxArgs ));
136
+ Arrays .stream (RedisCommand .values ())
137
+ . forEach ( command -> assertThat (command .requiresExactNumberOfArguments ())
138
+ .describedAs ("Redis command [%s] failed requires exact arguments check" ). isEqualTo (
139
+ ReflectionTestUtils . getField (command , " minArgs" ) == ReflectionTestUtils . getField ( command , " maxArgs" ) ));
139
140
}
140
141
141
142
}
You can’t perform that action at this time.
0 commit comments