Skip to content

Commit 9b87d3f

Browse files
kazhangchristophstrobl
authored andcommitted
DATAREDIS-1210 - Fix loop in StreamReadOptions toString().
Original Pull Request: #557
1 parent 3022efa commit 9b87d3f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/main/java/org/springframework/data/redis/connection/stream/StreamReadOptions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*
2727
* @author Mark Paluch
2828
* @author Christoph Strobl
29+
* @author Kaizhou Zhang
2930
* @see 2.2
3031
*/
3132
public class StreamReadOptions {
@@ -124,8 +125,9 @@ public boolean isNoack() {
124125

125126
@Override
126127
public String toString() {
127-
return "StreamReadOptions{" + "block=" + block + ", count=" + count + ", noack=" + noack + ", autoAcknowledge="
128-
+ autoAcknowledge() + ", blocking=" + isBlocking() + '}';
128+
129+
return "StreamReadOptions{" + "block=" + block + ", count=" + count + ", noack=" + noack + ", blocking="
130+
+ isBlocking() + '}';
129131
}
130132

131133
@Override

src/test/java/org/springframework/data/redis/connection/stream/StreamReadOptionsUnitTests.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* Unit tests for {@link StreamReadOptions}.
2626
*
2727
* @author Mark Paluch
28+
* @author Kaizhou Zhang
2829
*/
2930
public class StreamReadOptionsUnitTests {
3031

@@ -35,4 +36,11 @@ public void shouldConsiderBlocking() {
3536
assertThat(StreamReadOptions.empty().block(Duration.ofSeconds(1)).isBlocking()).isTrue();
3637
assertThat(StreamReadOptions.empty().block(Duration.ZERO).isBlocking()).isTrue();
3738
}
39+
40+
@Test // DATAREDIS-1210
41+
public void testToString() {
42+
43+
assertThat(StreamReadOptions.empty().toString())
44+
.isEqualTo("StreamReadOptions{block=null, count=null, noack=false, blocking=false}");
45+
}
3846
}

0 commit comments

Comments
 (0)