diff options
Diffstat (limited to 'src/test/java/com')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index ea99fac3..f08c49f5 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -220,6 +220,8 @@ public class ServerTests { private Resource noteWithDocument; @Value("classpath:2936611-57.jpg") private Resource jpegNoJfifTiff; + @Value("classpath:Transparent.gif") + private Resource invisiblePixel; @Inject private KeystoreManager testKeystoreManager; @@ -954,8 +956,7 @@ public class ServerTests { int freefdrid = messagesService.createReply(mid, 0, freefd, "again", null); mockMvc.perform(get(String.format("/api/thread/mark_read/%d-%d.gif?hash=%s", mid, freefdrid, ugnichHash))) .andExpect(status().isOk()) - .andExpect(content().bytes(IOUtils.toByteArray( - Objects.requireNonNull(getClass().getClassLoader().getResource("Transparent.gif"))))); + .andExpect(content().bytes(IOUtils.toByteArray(invisiblePixel.getInputStream()))); assertThat(lastRead.apply(ugnich, mid), is(freefdrid)); privacyQueriesService.blacklistUser(ugnich, freefd); int newfreefdrid = messagesService.createReply(mid, 0, freefd, "from ban", null); @@ -1083,9 +1084,9 @@ public class ServerTests { .andExpect(status().isBadRequest()); } @Test - public void attachmentSizeTests() throws URISyntaxException, IOException { + public void attachmentSizeTests() throws IOException { ImageUtils imageUtils = new ImageUtils(StringUtils.EMPTY, StringUtils.EMPTY); - Attachment attachment = imageUtils.getAttachment(new File(getClass().getClassLoader().getResource("Transparent.gif").toURI())); + Attachment attachment = imageUtils.getAttachment(new File(invisiblePixel.getURI())); assertThat(attachment.getHeight(), is(1)); assertThat(attachment.getWidth(), is(1)); } |