diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplateTest.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplateTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplateTest.java index f46723272ab..9b3b1deb392 100644 --- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplateTest.java +++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/issue/notification/NewIssuesEmailTemplateTest.java @@ -19,12 +19,15 @@ */ package org.sonar.plugins.core.issue.notification; +import org.junit.After; import org.junit.Before; import org.junit.Test; import org.sonar.api.config.EmailSettings; import org.sonar.api.notifications.Notification; import org.sonar.plugins.emailnotifications.api.EmailMessage; +import java.util.TimeZone; + import static org.fest.assertions.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -32,12 +35,20 @@ import static org.mockito.Mockito.when; public class NewIssuesEmailTemplateTest { NewIssuesEmailTemplate template; + TimeZone initialTimeZone = TimeZone.getDefault(); @Before public void setUp() { EmailSettings settings = mock(EmailSettings.class); when(settings.getServerBaseURL()).thenReturn("http://nemo.sonarsource.org"); template = new NewIssuesEmailTemplate(settings); + TimeZone.setDefault(TimeZone.getTimeZone("GMT")); + } + + @After + public void tearDown() { + TimeZone.setDefault(initialTimeZone); + } @Test @@ -64,7 +75,7 @@ public class NewIssuesEmailTemplateTest { .setFieldValue("count", "32") .setFieldValue("projectName", "Struts") .setFieldValue("projectKey", "org.apache:struts") - .setFieldValue("projectDate", "2010-05-18T16:50:45+0200"); + .setFieldValue("projectDate", "2010-05-18T14:50:45+0000"); EmailMessage message = template.format(notification); assertThat(message.getMessageId()).isEqualTo("new-issues/org.apache:struts"); @@ -73,7 +84,7 @@ public class NewIssuesEmailTemplateTest { "Project: Struts\n" + "32 new issues\n" + "\n" + - "See it in SonarQube: http://nemo.sonarsource.org/issues/search?componentRoots=org.apache%3Astruts&createdAt=2010-05-18T16%3A50%3A45%2B0200\n"); + "See it in SonarQube: http://nemo.sonarsource.org/issues/search?componentRoots=org.apache%3Astruts&createdAt=2010-05-18T14%3A50%3A45%2B0000\n"); } @Test |