]> source.dussan.org Git - sonarqube.git/commitdiff
Fix NewIssuesEmailTemplateTest on some Windows env
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 1 Oct 2015 11:19:37 +0000 (13:19 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 1 Oct 2015 11:19:37 +0000 (13:19 +0200)
server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest.java

index 5e58492a861887469a3f942eaeb0456f1924b0af..386b77905a53fdaa01bf692a53938e9d7af46dfe 100644 (file)
@@ -20,6 +20,7 @@
 package org.sonar.server.issue.notification;
 
 import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.invocation.InvocationOnMock;
@@ -112,7 +113,7 @@ public class NewIssuesEmailTemplateTest {
 
     // TODO datetime to be completed when test is isolated from JVM timezone
     String expectedContent = IOUtils.toString(getClass().getResource("NewIssuesEmailTemplateTest/email_with_all_details.txt"), StandardCharsets.UTF_8);
-    assertThat(message.getMessage()).startsWith(expectedContent);
+    assertThat(message.getMessage()).startsWith(StringUtils.remove(expectedContent, '\r'));
   }
 
   @Test
@@ -123,7 +124,7 @@ public class NewIssuesEmailTemplateTest {
 
     // TODO datetime to be completed when test is isolated from JVM timezone
     String expectedContent = IOUtils.toString(getClass().getResource("NewIssuesEmailTemplateTest/email_with_partial_details.txt"), StandardCharsets.UTF_8);
-    assertThat(message.getMessage()).startsWith(expectedContent);
+    assertThat(message.getMessage()).startsWith(StringUtils.remove(expectedContent, '\r'));
   }
 
   @Test