tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject [4/5] tomee git commit: Improvement on the test
Date Wed, 28 Nov 2018 23:01:33 GMT
Improvement on the test


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

Branch: refs/heads/master
Commit: bf0251a46f15205c0fc9f359c7162d61756dac4d
Parents: ee90765
Author: ivanjunckes <ijunckes@tomitribe.com>
Authored: Tue Nov 27 15:04:42 2018 -0200
Committer: ivanjunckes <ijunckes@tomitribe.com>
Committed: Tue Nov 27 15:04:42 2018 -0200

----------------------------------------------------------------------
 .../test/java/org/superbiz/rest/WeatherServiceTest.java  | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/bf0251a4/examples/mp-metrics-counted/src/test/java/org/superbiz/rest/WeatherServiceTest.java
----------------------------------------------------------------------
diff --git a/examples/mp-metrics-counted/src/test/java/org/superbiz/rest/WeatherServiceTest.java
b/examples/mp-metrics-counted/src/test/java/org/superbiz/rest/WeatherServiceTest.java
index f4eb0fe..f40042e 100644
--- a/examples/mp-metrics-counted/src/test/java/org/superbiz/rest/WeatherServiceTest.java
+++ b/examples/mp-metrics-counted/src/test/java/org/superbiz/rest/WeatherServiceTest.java
@@ -36,7 +36,9 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import java.io.StringReader;
 import java.net.URL;
+import java.util.stream.Stream;
 
+import static junit.framework.TestCase.assertTrue;
 import static org.junit.Assert.assertEquals;
 
 @RunWith(Arquillian.class)
@@ -123,6 +125,13 @@ public class WeatherServiceTest {
                 "}";
 
         JsonObject expectedJson = Json.createReader(new StringReader(expected)).readObject();
-        assertEquals(expectedJson, metadataJson);
+        assertEquals(expectedJson.keySet().size(), metadataJson.keySet().size());
+
+        String[] expectedKeys = new String[]{"description", "displayName", "name", "reusable",
"tags", "type", "typeRaw", "unit"};
+        Stream.of(expectedKeys).forEach((text) -> {
+          assertTrue("Expected: " + text
+                  + " to be present in " + expected,
+                  expectedJson.getJsonObject("weather_day_status").get(text) != null);
+        });
     }
 }


Mime
View raw message