From d6dc3f9941f448f337a109258b3c72acc5b29410 Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Mon, 25 Feb 2019 22:49:29 +0530 Subject: [PATCH 1/2] BAEL-10944 Fixed failing tests --- pom.xml | 4 ++-- restx/pom.xml | 2 +- .../resources/specs/hello/should_admin_say_hello.spec.yaml | 2 +- .../resources/specs/hello/should_anyone_say_hello.spec.yaml | 2 +- .../resources/specs/hello/should_user1_say_hello.spec.yaml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 9b36b30f59..da7b260541 100644 --- a/pom.xml +++ b/pom.xml @@ -561,7 +561,7 @@ reactor-core rest-with-spark-java resteasy - + restx rule-engines/easy-rules rule-engines/openl-tablets @@ -1280,7 +1280,7 @@ reactor-core rest-with-spark-java resteasy - + restx rule-engines/easy-rules rule-engines/openl-tablets diff --git a/restx/pom.xml b/restx/pom.xml index cc503f89b6..16d785956a 100644 --- a/restx/pom.xml +++ b/restx/pom.xml @@ -151,6 +151,6 @@ 1.8 1.8 0.35-rc4 - 1.0.13 + 1.2.3 diff --git a/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml index 1b7b8f0f90..f50059903f 100644 --- a/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml +++ b/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml @@ -7,4 +7,4 @@ wts: GET message $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"admin","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} then: | - {"message":"hello admin, it's 01:18:00"} + {"message":"hello admin, it's 04:48:00"} diff --git a/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml index 29b6faca34..4b84cee9f4 100644 --- a/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml +++ b/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml @@ -5,4 +5,4 @@ wts: - when: | GET hello?who=xavier then: | - {"message":"hello xavier, it's 01:18:00"} + {"message":"hello xavier, it's 04:48:00"} diff --git a/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml index 791a3a2776..825d1bb1b3 100644 --- a/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml +++ b/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml @@ -7,4 +7,4 @@ wts: GET message $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"user1","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} then: | - {"message":"hello user1, it's 01:18:00"} + {"message":"hello user1, it's 04:48:00"} From 4be7eaf4198fbb348fb6bc3a514b67349565be8f Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Tue, 26 Feb 2019 17:52:54 +0530 Subject: [PATCH 2/2] BAEL-10944 Added logic of returning fixed date time zone in HelloResource --- restx/src/main/java/restx/demo/rest/HelloResource.java | 6 ++++-- .../resources/specs/hello/should_admin_say_hello.spec.yaml | 2 +- .../resources/specs/hello/should_anyone_say_hello.spec.yaml | 2 +- .../resources/specs/hello/should_user1_say_hello.spec.yaml | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/restx/src/main/java/restx/demo/rest/HelloResource.java b/restx/src/main/java/restx/demo/rest/HelloResource.java index 5cb2c2a5e6..115212ddf9 100644 --- a/restx/src/main/java/restx/demo/rest/HelloResource.java +++ b/restx/src/main/java/restx/demo/rest/HelloResource.java @@ -3,6 +3,8 @@ package restx.demo.rest; import restx.demo.domain.Message; import restx.demo.Roles; import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; + import restx.annotations.GET; import restx.annotations.POST; import restx.annotations.RestxResource; @@ -29,7 +31,7 @@ public class HelloResource { return new Message().setMessage(String.format( "hello %s, it's %s", RestxSession.current().getPrincipal().get().getName(), - DateTime.now().toString("HH:mm:ss"))); + DateTime.now(DateTimeZone.UTC).toString("HH:mm:ss"))); } /** @@ -44,7 +46,7 @@ public class HelloResource { public Message helloPublic(String who) { return new Message().setMessage(String.format( "hello %s, it's %s", - who, DateTime.now().toString("HH:mm:ss"))); + who, DateTime.now(DateTimeZone.UTC).toString("HH:mm:ss"))); } public static class MyPOJO { diff --git a/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml index f50059903f..7a8bd9119f 100644 --- a/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml +++ b/restx/src/test/resources/specs/hello/should_admin_say_hello.spec.yaml @@ -7,4 +7,4 @@ wts: GET message $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"admin","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} then: | - {"message":"hello admin, it's 04:48:00"} + {"message":"hello admin, it's 23:18:00"} diff --git a/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml index 4b84cee9f4..d23e5ae6bf 100644 --- a/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml +++ b/restx/src/test/resources/specs/hello/should_anyone_say_hello.spec.yaml @@ -5,4 +5,4 @@ wts: - when: | GET hello?who=xavier then: | - {"message":"hello xavier, it's 04:48:00"} + {"message":"hello xavier, it's 23:18:00"} diff --git a/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml b/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml index 825d1bb1b3..2db8a01003 100644 --- a/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml +++ b/restx/src/test/resources/specs/hello/should_user1_say_hello.spec.yaml @@ -7,4 +7,4 @@ wts: GET message $RestxSession: {"_expires":"2013-09-27T01:18:00.822+02:00","principal":"user1","sessionKey":"e2b4430f-9541-4602-9a3a-413d17c56a6b"} then: | - {"message":"hello user1, it's 04:48:00"} + {"message":"hello user1, it's 23:18:00"}