Fix unit test.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/email/trunk@1533924 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/test/java/org/apache/commons/mail/SimpleEmailTest.java b/src/test/java/org/apache/commons/mail/SimpleEmailTest.java
index 20609c2..24f4434 100644
--- a/src/test/java/org/apache/commons/mail/SimpleEmailTest.java
+++ b/src/test/java/org/apache/commons/mail/SimpleEmailTest.java
@@ -144,7 +144,7 @@
}
String strSubject = "Test Msg Subject";
- String strMessage = "Test Msg Body グ ケ ゲ コ ゴ";
+ String strMessage = "Test Msg Body ä"; // add non-ascii character, otherwise us-ascii will be used
this.email.setSubject(strSubject);
this.email.setMsg(strMessage);
@@ -152,15 +152,10 @@
this.email.send();
this.fakeMailServer.stop();
- validateSend(
- this.fakeMailServer,
- strSubject,
- this.email.getMsg(),
- this.email.getFromAddress(),
- this.email.getToAddresses(),
- this.email.getCcAddresses(),
- this.email.getBccAddresses(),
- true);
+
+ String message = getMessageAsString(0);
+ // check that the charset has been correctly set
+ assertTrue(message.contains("Content-Type: text/plain; charset=utf-8"));
System.clearProperty(EmailConstants.MAIL_MIME_CHARSET);
}