cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [5/6] cxf git commit: CXF-6046: Enhance SwaggerFeature to support JAX-RS annotations. Fixed test cases (systests)
Date Thu, 09 Jul 2015 12:18:38 GMT
CXF-6046: Enhance SwaggerFeature to support JAX-RS annotations. Fixed test cases (systests)


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

Branch: refs/heads/3.0.x-fixes
Commit: d3fc4186ad97df724c2eb8c490c622e077dcb35e
Parents: 4d4ddf0
Author: reta <drreta@gmail.com>
Authored: Wed Jan 7 09:13:03 2015 -0800
Committer: Akitoshi Yoshida <ay@apache.org>
Committed: Thu Jul 9 14:09:49 2015 +0200

----------------------------------------------------------------------
 systests/jaxrs/pom.xml                             |  6 ++++++
 .../AbstractSwaggerServiceDescriptionTest.java     | 17 +++++++++--------
 2 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d3fc4186/systests/jaxrs/pom.xml
----------------------------------------------------------------------
diff --git a/systests/jaxrs/pom.xml b/systests/jaxrs/pom.xml
index 6564e02..808ee0e 100644
--- a/systests/jaxrs/pom.xml
+++ b/systests/jaxrs/pom.xml
@@ -497,6 +497,12 @@
             </exclusions>
         </dependency>
         <dependency>
+            <groupId>org.skyscreamer</groupId>
+            <artifactId>jsonassert</artifactId>
+            <version>1.2.3</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <!-- activate atmosphere. Its use can be disabled by setting
                  org.apache.cxf.transport.websocket.atmosphere.disabled to "true" -->
             <groupId>org.atmosphere</groupId>

http://git-wip-us.apache.org/repos/asf/cxf/blob/d3fc4186/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwaggerServiceDescriptionTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwaggerServiceDescriptionTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwaggerServiceDescriptionTest.java
index 570b99f..723f680 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwaggerServiceDescriptionTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwaggerServiceDescriptionTest.java
@@ -39,8 +39,7 @@ import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 import org.junit.Ignore;
 import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.equalTo;
+import org.skyscreamer.jsonassert.JSONAssert;
 
 public abstract class AbstractSwaggerServiceDescriptionTest extends AbstractBusClientServerTestBase
{
     private static final JsonObject DELETE_METHOD_SPEC = Json.createObjectBuilder()
@@ -165,8 +164,9 @@ public abstract class AbstractSwaggerServiceDescriptionTest extends AbstractBusC
             final Response r = client.get();
             assertEquals(Status.OK.getStatusCode(), r.getStatus());
             
-            assertThat(IOUtils.readStringFromStream((InputStream)r.getEntity()), 
-                equalTo(Json.createObjectBuilder()
+            JSONAssert.assertEquals(
+                IOUtils.readStringFromStream((InputStream)r.getEntity()), 
+                Json.createObjectBuilder()
                     .add("apiVersion", "1.0.0")
                     .add("swaggerVersion", "1.2")
                     .add("apis", Json.createArrayBuilder()
@@ -181,7 +181,7 @@ public abstract class AbstractSwaggerServiceDescriptionTest extends AbstractBusC
                         .add("contact", "committer@apache.org")
                         .add("license", "Apache 2.0 License")
                         .add("licenseUrl", "http://www.apache.org/licenses/LICENSE-2.0.html")
-                    ).build().toString()));
+                    ).build().toString(), false);
         } finally {
             client.close();
         }
@@ -195,8 +195,9 @@ public abstract class AbstractSwaggerServiceDescriptionTest extends AbstractBusC
             final Response r = client.get();
             assertEquals(Status.OK.getStatusCode(), r.getStatus());
                     
-            assertThat(IOUtils.readStringFromStream((InputStream)r.getEntity()), 
-                equalTo(Json.createObjectBuilder()
+            JSONAssert.assertEquals(
+                IOUtils.readStringFromStream((InputStream)r.getEntity()), 
+                Json.createObjectBuilder()
                     .add("apiVersion", "1.0.0")
                     .add("swaggerVersion", "1.2")
                     .add("basePath", "http://localhost:" + getPort() + "/")
@@ -210,7 +211,7 @@ public abstract class AbstractSwaggerServiceDescriptionTest extends AbstractBusC
                         .add(Json.createObjectBuilder()
                             .add("path", "/bookstore")
                             .add("operations", Json.createArrayBuilder().add(GET_METHOD_SPEC))))
-                    .add("models", BOOK_MODEL_SPEC).build().toString()));
+                    .add("models", BOOK_MODEL_SPEC).build().toString(), false);
         } finally {
             client.close();
         }


Mime
View raw message