diff --git a/greenmail-core/src/test/java/com/icegreen/greenmail/specificmessages/EncodingTest.java b/greenmail-core/src/test/java/com/icegreen/greenmail/specificmessages/EncodingTest.java index 5e9c6319b9..899a086546 100644 --- a/greenmail-core/src/test/java/com/icegreen/greenmail/specificmessages/EncodingTest.java +++ b/greenmail-core/src/test/java/com/icegreen/greenmail/specificmessages/EncodingTest.java @@ -219,6 +219,7 @@ public void messagesAdded(MessageCountEvent e) { } }; inboxFolder.addMessageCountListener(listener); + String fileName = "кирилица testimage_ünicöde_\uD83C\uDF36"; new Thread(() -> { try { Thread.sleep(100); @@ -226,10 +227,9 @@ public void messagesAdded(MessageCountEvent e) { // Ignore } try { - String fileName = MimeUtility.encodeText("кирилица testimage_ünicöde_\uD83C\uDF36"); GreenMailUtil.sendAttachmentEmail( "to@localhost", "from@localhost", "subject", "body", - new byte[]{0, 1, 2}, "image/gif", fileName, + new byte[]{0, 1, 2}, "image/gif", MimeUtility.encodeText(fileName), "testimage_description", greenMail.getSmtp().getServerSetup()); } catch (UnsupportedEncodingException ex) { assertThat(false).isTrue(); @@ -238,6 +238,7 @@ public void messagesAdded(MessageCountEvent e) { ((IMAPFolder) inboxFolder).idle(true); assertThat(messages[0].getContent() != null).isTrue(); + assertThat(((Multipart) messages[0].getContent()).getBodyPart(1).getFileName()).isEqualTo(fileName); inboxFolder.close(); } finally {