DATAREDIS-1210 - Fix loop in StreamReadOptions toString().

Original Pull Request: #557
This commit is contained in:
kazhang
2020-08-28 13:15:19 +08:00
committed by Christoph Strobl
parent 3022efa843
commit 9b87d3f080
2 changed files with 12 additions and 2 deletions

View File

@@ -26,6 +26,7 @@ import org.springframework.util.ObjectUtils;
*
* @author Mark Paluch
* @author Christoph Strobl
* @author Kaizhou Zhang
* @see 2.2
*/
public class StreamReadOptions {
@@ -124,8 +125,9 @@ public class StreamReadOptions {
@Override
public String toString() {
return "StreamReadOptions{" + "block=" + block + ", count=" + count + ", noack=" + noack + ", autoAcknowledge="
+ autoAcknowledge() + ", blocking=" + isBlocking() + '}';
return "StreamReadOptions{" + "block=" + block + ", count=" + count + ", noack=" + noack + ", blocking="
+ isBlocking() + '}';
}
@Override

View File

@@ -25,6 +25,7 @@ import org.junit.Test;
* Unit tests for {@link StreamReadOptions}.
*
* @author Mark Paluch
* @author Kaizhou Zhang
*/
public class StreamReadOptionsUnitTests {
@@ -35,4 +36,11 @@ public class StreamReadOptionsUnitTests {
assertThat(StreamReadOptions.empty().block(Duration.ofSeconds(1)).isBlocking()).isTrue();
assertThat(StreamReadOptions.empty().block(Duration.ZERO).isBlocking()).isTrue();
}
@Test // DATAREDIS-1210
public void testToString() {
assertThat(StreamReadOptions.empty().toString())
.isEqualTo("StreamReadOptions{block=null, count=null, noack=false, blocking=false}");
}
}