yandrey321 commented on code in PR #10765:
URL: https://github.com/apache/ozone/pull/10765#discussion_r3596154257


##########
hadoop-hdds/client/src/test/java/org/apache/hadoop/hdds/scm/storage/TestChunkInputStream.java:
##########
@@ -284,4 +284,26 @@ public void connectsToNewPipeline() throws Exception {
       verify(newToken).encodeToUrlString();
     }
   }
+
+  @Test
+  public void testPositionedRead() throws Exception {
+    byte[] buffer = new byte[50];
+    ByteBuffer byteBuffer = ByteBuffer.wrap(buffer);
+    int bytesRead = chunkStream.read(30, byteBuffer);
+
+    assertEquals(50, bytesRead);
+    byte[] expected = Arrays.copyOfRange(chunkData, 30, 80);
+    assertArrayEquals(expected, buffer);
+  }
+
+  @Test
+  public void testPositionedReadFully() throws Exception {

Review Comment:
   how do we assert that stream was read till the end as text name suggest?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to