From 5c05eec1d21420ba6ca423064fbd493202770771 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 1 Oct 2015 13:19:37 +0200 Subject: [PATCH] Fix NewIssuesEmailTemplateTest on some Windows env --- .../issue/notification/NewIssuesEmailTemplateTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest.java index 5e58492a861..386b77905a5 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/NewIssuesEmailTemplateTest.java @@ -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 -- 2.39.5