@@ -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