This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new df41960  CXF-7581: SwaggerUIResourceFilter doesn't allow call to 
service endpoint. Adding more robust test cases
df41960 is described below

commit df41960292388518c42c4440d80d962c509dda6c
Author: reta <[email protected]>
AuthorDate: Wed Dec 13 16:43:18 2017 -0500

    CXF-7581: SwaggerUIResourceFilter doesn't allow call to service endpoint. 
Adding more robust test cases
---
 .../AbstractSwagger2ServiceDescriptionTest.java    |  3 +-
 .../description/BookStoreStylesheetsSwagger2.java  | 34 ++++++++++++++++++++++
 .../jaxrs/description/BookStoreSwagger2.java       |  8 -----
 3 files changed, 36 insertions(+), 9 deletions(-)

diff --git 
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
 
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
index c76fabf..ea07e36 100644
--- 
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
+++ 
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/AbstractSwagger2ServiceDescriptionTest.java
@@ -82,6 +82,7 @@ public abstract class AbstractSwagger2ServiceDescriptionTest 
extends AbstractBus
         protected void run() {
             final JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
             sf.setResourceClasses(BookStoreSwagger2.class);
+            sf.setResourceClasses(BookStoreStylesheetsSwagger2.class);
             sf.setResourceProvider(BookStoreSwagger2.class,
                 new SingletonResourceProvider(new BookStoreSwagger2()));
             sf.setProvider(new JacksonJsonProvider());
@@ -192,7 +193,7 @@ public abstract class 
AbstractSwagger2ServiceDescriptionTest extends AbstractBus
         // Test that Swagger UI resources do not interfere with 
         // application-specific ones.
         WebClient uiClient = WebClient
-            .create("http://localhost:"; + getPort() + 
"/bookstore/css/book.css")
+            .create("http://localhost:"; + getPort() + "/css/book.css")
             .accept("text/css");
         String css = uiClient.get(String.class);
         assertThat(css, equalTo("body { background-color: lightblue; }"));
diff --git 
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/BookStoreStylesheetsSwagger2.java
 
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/BookStoreStylesheetsSwagger2.java
new file mode 100644
index 0000000..ca49c0f
--- /dev/null
+++ 
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/BookStoreStylesheetsSwagger2.java
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.jaxrs.description;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+@Path("/")
+public class BookStoreStylesheetsSwagger2 {
+    @Produces({ "text/css" })
+    @Path("/css/book.css")
+    @GET
+    public String getCss() {
+        return "body { background-color: lightblue; }"; 
+    }
+}
diff --git 
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/BookStoreSwagger2.java
 
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/BookStoreSwagger2.java
index 46336a6..871f82f 100644
--- 
a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/BookStoreSwagger2.java
+++ 
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/description/BookStoreSwagger2.java
@@ -79,12 +79,4 @@ public class BookStoreSwagger2 {
     public Response delete(@ApiParam(value = "id", required = true) 
@PathParam("id") String id) {
         return Response.ok().build();
     }
-    
-    @ApiOperation(hidden = true, value = "css")
-    @Produces({ "text/css" })
-    @Path("/css/book.css")
-    @GET
-    public String getCss() {
-        return "body { background-color: lightblue; }"; 
-    }
 }

-- 
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].

Reply via email to