aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-09-25 16:58:26 +0300
committerGravatar Vitaly Takmazov2018-09-25 16:58:26 +0300
commit71bf01c9d7056d68aaa34144d8cd6c49d20b7ca5 (patch)
treebf99f606dc77a41719de0ae916dc1d9f7a06b147 /juick-server/src/test
parentf0deeb7d56e3a1cbdb9a809e93855c0c571c8bc0 (diff)
fix test failed only under windows
Diffstat (limited to 'juick-server/src/test')
-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 {