Skip to content

Commit 406535d

Browse files
author
Sharon Shabtai
committed
code review changes
1 parent 934d452 commit 406535d

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

ds3-sdk/src/test/java/com/spectralogic/ds3client/Ds3Client_Test.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ public void getTape() throws IOException, SignatureException {
921921
assertThat(tape.getId(), is(UUID.fromString("c7c431df-f95d-4533-b350-ffd7a8a5caac")));
922922
}
923923

924-
@Test
924+
@Test(expected = ContentLengthNotMatchException.class)
925925
public void getObjectVerifyFullPayload() throws IOException, SignatureException {
926926
final String jobIdString = "a4a586a1-cb80-4441-84e2-48974e982d51";
927927
final Map<String, String> queryParams = new HashMap<>();
@@ -934,14 +934,10 @@ public void getObjectVerifyFullPayload() throws IOException, SignatureException
934934
final ByteArraySeekableByteChannel resultChannel = new ByteArraySeekableByteChannel();
935935
final String stringResponse = "Response";
936936

937-
try {
938-
MockNetwork
939-
.expecting(HttpVerb.GET, "/bucketName/object", queryParams, null)
940-
.returning(200, stringResponse, responseHeaders)
941-
.asClient()
942-
.getObject(new GetObjectRequest("bucketName", "object", 0, UUID.fromString(jobIdString), resultChannel));
943-
} catch (final ContentLengthNotMatchException ex) {
944-
assertThat(ex.getMessage(), is("The Content length for object (4) not match the number of byte read (8)"));
945-
}
937+
MockNetwork
938+
.expecting(HttpVerb.GET, "/bucketName/object", queryParams, null)
939+
.returning(200, stringResponse, responseHeaders)
940+
.asClient()
941+
.getObject(new GetObjectRequest("bucketName", "object", 0, UUID.fromString(jobIdString), resultChannel));
946942
}
947943
}

0 commit comments

Comments
 (0)