tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlmonte...@apache.org
Subject [10/18] tomee git commit: [TOMEE-2291] - Fault Tolerance Microprofile example for @Retry
Date Fri, 07 Dec 2018 12:42:32 GMT
[TOMEE-2291] - Fault Tolerance Microprofile example for @Retry

Added missed test for statusOfMonth
Changed the return message of statusOfMonth from weekend to month


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/662125a7
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/662125a7
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/662125a7

Branch: refs/heads/master
Commit: 662125a70537c94cd66887e06b71fcf87610b96e
Parents: 2314bf9
Author: josehenriqueventura <J2705hvq*>
Authored: Mon Dec 3 20:17:12 2018 +0000
Committer: josehenriqueventura <jose.ventura@protonmail.com>
Committed: Wed Dec 5 22:51:27 2018 +0000

----------------------------------------------------------------------
 .../src/main/java/org/superbiz/rest/WeatherGateway.java       | 4 ++--
 .../src/test/java/org/superbiz/rest/WeatherServiceTest.java   | 7 +++++++
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/662125a7/examples/mp-faulttolerance-retry/src/main/java/org/superbiz/rest/WeatherGateway.java
----------------------------------------------------------------------
diff --git a/examples/mp-faulttolerance-retry/src/main/java/org/superbiz/rest/WeatherGateway.java
b/examples/mp-faulttolerance-retry/src/main/java/org/superbiz/rest/WeatherGateway.java
index 110113a..e2cf413 100644
--- a/examples/mp-faulttolerance-retry/src/main/java/org/superbiz/rest/WeatherGateway.java
+++ b/examples/mp-faulttolerance-retry/src/main/java/org/superbiz/rest/WeatherGateway.java
@@ -73,7 +73,7 @@ public class WeatherGateway {
         LOGGER.log(Level.SEVERE, String.format(FORECAST_BUSY_MESSAGE, counterStatusOfWeek.get()));
         throw new WeatherGatewayBusyServiceException();
     }
-    
+
     @Retry(retryOn = WeatherGatewayTimeoutException.class, maxRetries = 5, delay = 500, jitter
= 0)
     public String statusOfWeekend() {
         if (counterStatusOfWeekend.addAndGet(1) <= 5) {
@@ -91,7 +91,7 @@ public class WeatherGateway {
             statusOfMonthInstant = Instant.now();
             throw new WeatherGatewayTimeoutException();
         }
-        return "The Forecast for the Weekend is Scattered Showers.";
+        return "The Forecast for the Month is sunny most of the days";
     }
 
     @Retry(retryOn = WeatherGatewayTimeoutException.class, maxRetries = 5, delay = 500, jitter
= 500, maxDuration = 1000)

http://git-wip-us.apache.org/repos/asf/tomee/blob/662125a7/examples/mp-faulttolerance-retry/src/test/java/org/superbiz/rest/WeatherServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/mp-faulttolerance-retry/src/test/java/org/superbiz/rest/WeatherServiceTest.java
b/examples/mp-faulttolerance-retry/src/test/java/org/superbiz/rest/WeatherServiceTest.java
index 4f43926..96fab3d 100644
--- a/examples/mp-faulttolerance-retry/src/test/java/org/superbiz/rest/WeatherServiceTest.java
+++ b/examples/mp-faulttolerance-retry/src/test/java/org/superbiz/rest/WeatherServiceTest.java
@@ -74,6 +74,13 @@ public class WeatherServiceTest {
     }
 
     @Test
+    public void testStatusOfMonth() {
+        WebTarget webTarget = this.client.target(this.base.toExternalForm());
+        Response response = webTarget.path("/weather/month/status").request().get();
+        assertEquals("The Forecast for the Month is sunny most of the days", response.readEntity(String.class));
+    }
+
+    @Test
     public void testStatusOfYear() {
         WebTarget webTarget = this.client.target(this.base.toExternalForm());
         Response response = webTarget.path("/weather/year/status").request().get();


Mime
View raw message