cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cxf git commit: CXF-6046: Enhance SwaggerFeature to support JAX-RS annotations. Fixed test cases (systests)
Date Wed, 07 Jan 2015 17:13:11 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 83555de6d -> d5b502a60


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/d5b502a6
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d5b502a6
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d5b502a6

Branch: refs/heads/master
Commit: d5b502a60d2934a42e32cb6225224ff75c66aa37
Parents: 83555de
Author: reta <drreta@gmail.com>
Authored: Wed Jan 7 09:13:03 2015 -0800
Committer: reta <drreta@gmail.com>
Committed: Wed Jan 7 09:13:03 2015 -0800

----------------------------------------------------------------------
 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/d5b502a6/systests/jaxrs/pom.xml
----------------------------------------------------------------------
diff --git a/systests/jaxrs/pom.xml b/systests/jaxrs/pom.xml
index f5f5e22..d4e83f1 100644
--- a/systests/jaxrs/pom.xml
+++ b/systests/jaxrs/pom.xml
@@ -490,6 +490,12 @@
             	</exclusion>
             </exclusions>
         </dependency>
+        <dependency>
+            <groupId>org.skyscreamer</groupId>
+            <artifactId>jsonassert</artifactId>
+            <version>1.2.3</version>
+            <scope>test</scope>
+    </dependency>
     </dependencies>
     <build>
         <plugins>

http://git-wip-us.apache.org/repos/asf/cxf/blob/d5b502a6/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