aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/test/java/com')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java20
1 files changed, 8 insertions, 12 deletions
diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
index 3bdf5b3b..4e4ad9c4 100644
--- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
@@ -1183,18 +1183,14 @@ public class ServerTests {
public void changeExtensionWhenReceiveFileWithWrongContentType() throws Exception {
Path pngOutput = Paths.get(tmpDir, "cmyk.png");
Files.deleteIfExists(pngOutput);
- try {
- Files.copy(getClass().getClassLoader().getResourceAsStream("cmyk.jpg"), pngOutput);
- assertThat(pngOutput.toFile().exists(), is(true));
- CommandResult postJpgCmyk = commandsManager.processCommand(ugnich, "YO", pngOutput.toUri());
- assertThat(postJpgCmyk.getNewMessage().isPresent(), is(true));
- assertThat(postJpgCmyk.getNewMessage().get().getAttachmentType(), is("jpg"));
- CommandResult replyJpgCmyk = commandsManager.processCommand(ugnich, String.format("#%d YO", postJpgCmyk.getNewMessage().get().getMid()), pngOutput.toUri());
- assertThat(replyJpgCmyk.getNewMessage().isPresent(), is(true));
- assertThat(replyJpgCmyk.getNewMessage().get().getAttachmentType(), is("jpg"));
- } finally {
- Files.deleteIfExists(pngOutput);
- }
+ Files.copy(getClass().getClassLoader().getResourceAsStream("cmyk.jpg"), pngOutput);
+ assertThat(pngOutput.toFile().exists(), is(true));
+ CommandResult postJpgCmyk = commandsManager.processCommand(ugnich, "YO", pngOutput.toUri());
+ assertThat(postJpgCmyk.getNewMessage().isPresent(), is(true));
+ assertThat(postJpgCmyk.getNewMessage().get().getAttachmentType(), is("jpg"));
+ CommandResult replyJpgCmyk = commandsManager.processCommand(ugnich, String.format("#%d YO", postJpgCmyk.getNewMessage().get().getMid()), pngOutput.toUri());
+ assertThat(replyJpgCmyk.getNewMessage().isPresent(), is(true));
+ assertThat(replyJpgCmyk.getNewMessage().get().getAttachmentType(), is("jpg"));
}
@Test
public void messageEditingSpec() throws Exception {