From dc0c20cd0c55964073f43f27fbcb773704721760 Mon Sep 17 00:00:00 2001 From: bgamard Date: Mon, 16 May 2022 18:53:08 +0200 Subject: [PATCH] moved tests --- .../java/com/sismics/docs/rest/TestFileResource.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/docs-web/src/test/java/com/sismics/docs/rest/TestFileResource.java b/docs-web/src/test/java/com/sismics/docs/rest/TestFileResource.java index ee01b8fd..ca2f8c24 100644 --- a/docs-web/src/test/java/com/sismics/docs/rest/TestFileResource.java +++ b/docs-web/src/test/java/com/sismics/docs/rest/TestFileResource.java @@ -57,7 +57,6 @@ public class TestFileResource extends BaseJerseyTest { .get(); InputStream is = (InputStream) response.getEntity(); byte[] fileBytes = ByteStreams.toByteArray(is); - Assert.assertEquals(MimeType.IMAGE_JPEG, MimeTypeUtil.guessMimeType(fileBytes, null)); Assert.assertTrue(fileBytes.length > 0); // Get the thumbnail data @@ -69,7 +68,6 @@ public class TestFileResource extends BaseJerseyTest { Assert.assertEquals(Status.OK, Status.fromStatusCode(response.getStatus())); is = (InputStream) response.getEntity(); fileBytes = ByteStreams.toByteArray(is); - Assert.assertEquals(MimeType.IMAGE_JPEG, MimeTypeUtil.guessMimeType(fileBytes, null)); Assert.assertTrue(fileBytes.length > 0); // Get the content data @@ -89,7 +87,6 @@ public class TestFileResource extends BaseJerseyTest { Assert.assertEquals(Status.OK, Status.fromStatusCode(response.getStatus())); is = (InputStream) response.getEntity(); fileBytes = ByteStreams.toByteArray(is); - Assert.assertEquals(MimeType.IMAGE_JPEG, MimeTypeUtil.guessMimeType(fileBytes, null)); Assert.assertTrue(fileBytes.length > 0); // Check that the files are not readable directly from FS @@ -157,10 +154,7 @@ public class TestFileResource extends BaseJerseyTest { .cookie(TokenBasedSecurityFilter.COOKIE_NAME, file1Token) .get(); Assert.assertEquals(Status.OK, Status.fromStatusCode(response.getStatus())); - is = (InputStream) response.getEntity(); - fileBytes = ByteStreams.toByteArray(is); - Assert.assertEquals(MimeType.APPLICATION_ZIP, MimeTypeUtil.guessMimeType(fileBytes, null)); - + // Deletes a file json = target().path("/file/" + file1Id).request() .cookie(TokenBasedSecurityFilter.COOKIE_NAME, file1Token) @@ -368,7 +362,6 @@ public class TestFileResource extends BaseJerseyTest { Assert.assertEquals(Status.OK, Status.fromStatusCode(response.getStatus())); InputStream is = (InputStream) response.getEntity(); byte[] fileBytes = ByteStreams.toByteArray(is); - Assert.assertEquals(MimeType.IMAGE_JPEG, MimeTypeUtil.guessMimeType(fileBytes, null)); Assert.assertTrue(fileBytes.length > 0); // Get the file data @@ -377,7 +370,6 @@ public class TestFileResource extends BaseJerseyTest { .get(); is = (InputStream) response.getEntity(); fileBytes = ByteStreams.toByteArray(is); - Assert.assertEquals(MimeType.IMAGE_JPEG, MimeTypeUtil.guessMimeType(fileBytes, null)); Assert.assertEquals(163510, fileBytes.length); // Create another document