From 3580f4e88783427a6a03cc643d9976b961d213c8 Mon Sep 17 00:00:00 2001 From: Joseph McCarthy Date: Fri, 25 Dec 2015 01:44:15 +0000 Subject: [PATCH] Updated Build Script for TimeZone --- .travis.yml | 3 +++ .../java/net/rcarz/jiraclient/WorklogTest.java | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index b2168ad..166425a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,3 +3,6 @@ jdk: - oraclejdk8 - oraclejdk7 - openjdk7 + +before_install: +- export TZ=Europe/London \ No newline at end of file diff --git a/src/test/java/net/rcarz/jiraclient/WorklogTest.java b/src/test/java/net/rcarz/jiraclient/WorklogTest.java index 8458809..91ff60f 100644 --- a/src/test/java/net/rcarz/jiraclient/WorklogTest.java +++ b/src/test/java/net/rcarz/jiraclient/WorklogTest.java @@ -4,6 +4,7 @@ import net.sf.json.JSONObject; import org.junit.Test; import org.junit.runner.RunWith; import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import java.text.SimpleDateFormat; @@ -27,23 +28,24 @@ public class WorklogTest { @Test(expected = JiraException.class) public void testJiraExceptionFromNonJSON() throws Exception { final RestClient mockRestClient = PowerMockito.mock(RestClient.class); - WorkLog.get(mockRestClient, "issueNumber", "someID"); + WorkLog.get(mockRestClient,"issueNumber","someID"); } @Test public void testToString() throws Exception { final RestClient mockRestClient = PowerMockito.mock(RestClient.class); final JSONObject mockJSONObject = new JSONObject(); - String dateString = "2013-09-29T20:16:19.854+0100"; + String dateString = "2015-12-24"; - mockJSONObject.put("created", dateString); + mockJSONObject.put("created",dateString); final JSONObject userJSON = new JSONObject(); - userJSON.put("name", "Joseph McCarthy"); + userJSON.put("name","Joseph McCarthy"); mockJSONObject.put("author", userJSON); - WorkLog workLog = new WorkLog(mockRestClient, mockJSONObject); - assertEquals("Sun Sep 29 00:00:00 BST 2013 by Joseph McCarthy", workLog.toString()); + + WorkLog workLog = new WorkLog(mockRestClient,mockJSONObject); + assertEquals("Thu Dec 24 00:00:00 GMT 2015 by Joseph McCarthy",workLog.toString()); } @Test