Swagger-Jaxrs Module Test Failures
| Q | A |
|---|---|
| Bug or feature request? | Bug |
| Which Swagger-Core version? | 1.5.18 |
| Which Java version? | 1.8 |
| Which JAX-RS framework & version? | RESTEasy 3.0.19 with JAX-RS 2.0 |
When following the instructions for building from the source (mvn -N followed by mvn install) there are 2 tests that fail for the swagger-jaxrs module. This is on an unmodified download of the 1.5.18 source from Git. The failed tests are testSwaggerJson and testSwaggerJsonUsingAcceptHeaders. All other modules do not appear to have any issues when building. The testing results I get are as follows:
<?xml version="1.0" encoding="UTF-8"?>
<testng-results skipped="0" failed="2" ignored="0" total="4" passed="2">
<reporter-output>
</reporter-output>
<suite name="Surefire suite" duration-ms="3086" started-at="2018-03-07T20:11:37Z" finished-at="2018-03-07T20:11:40Z">
<groups>
</groups>
<test name="Surefire test" duration-ms="3086" started-at="2018-03-07T20:11:37Z" finished-at="2018-03-07T20:11:40Z">
<class name="io.swagger.functional.test.ApiListingResourceIT">
<test-method status="PASS" signature="checkJetty()[pri:0, instance:io.swagger.functional.test.ApiListingResourceIT@48fa0f47]" name="checkJetty" is-config="true" duration-ms="12" started-at="2018-03-07T15:11:37Z" finished-at="2018-03-07T15:11:37Z">
<reporter-output>
</reporter-output>
</test-method> <!-- checkJetty -->
<test-method status="FAIL" signature="testSwaggerJson()[pri:0, instance:io.swagger.functional.test.ApiListingResourceIT@48fa0f47]" name="testSwaggerJson" duration-ms="2784" started-at="2018-03-07T15:11:37Z" finished-at="2018-03-07T15:11:40Z">
<exception class="java.lang.AssertionError">
<message>
<![CDATA[expected [{
"definitions" : {
"Car" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Detail" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire_Detail"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Summary" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
}
},
"type" : "object"
},
"Car_Summary-or-Sale" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
}
},
"type" : "object"
},
"Tire" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Tire_Detail" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Widget" : {
"properties" : {
"a" : {
"type" : "string"
},
"b" : {
"type" : "string"
},
"id" : {
"type" : "string"
}
},
"type" : "object"
}
},
"paths" : {
"/cars/all" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getAll",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return whole car",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car"
},
"type" : "array"
}
}
},
"summary" : "Return whole car",
"tags" : [ "cars" ]
}
},
"/cars/detail" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getDetails",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return car detail",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Detail"
},
"type" : "array"
}
}
},
"summary" : "Return car detail",
"tags" : [ "cars" ]
}
},
"/cars/sale" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getSaleSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Summary-or-Sale"
},
"type" : "array"
}
}
},
"summary" : "Return car sale summary",
"tags" : [ "cars" ]
}
},
"/cars/summary" : {
"get" : {
"consumes" : [ "List" ],
"description" : "",
"operationId" : "getSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"$ref" : "#/definitions/Car_Summary"
}
}
},
"summary" : "Return car summaries",
"tags" : [ "cars" ]
}
},
"/widgets/{widgetId}" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "Returns a pet when ID <= 10. ID > 10 or nonintegers will simulate API error conditions",
"operationId" : "getWidget",
"parameters" : [ {
"in" : "path",
"name" : "widgetId",
"required" : true,
"type" : "string"
} ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Returns widget with matching id"
}
},
"summary" : "Find pet by ID",
"tags" : [ "widgets" ]
}
}
},
"swagger" : "2.0",
"tags" : [ {
"name" : "cars"
}, {
"name" : "widgets"
} ]
}] but found [{
"definitions" : {
"Car" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Detail" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire_Detail"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Summary" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
}
},
"type" : "object"
},
"Car_Summary-or-Sale" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
}
},
"type" : "object"
},
"Tire" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Tire_Detail" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Widget" : {
"properties" : {
"a" : {
"type" : "string"
},
"b" : {
"type" : "string"
},
"id" : {
"type" : "string"
}
},
"type" : "object"
}
},
"paths" : {
"/cars/all" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getAll",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return whole car",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car"
},
"type" : "array"
}
}
},
"summary" : "Return whole car",
"tags" : [ "cars" ]
}
},
"/cars/detail" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getDetails",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return car detail",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Detail"
},
"type" : "array"
}
}
},
"summary" : "Return car detail",
"tags" : [ "cars" ]
}
},
"/cars/sale" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getSaleSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Summary-or-Sale"
},
"type" : "array"
}
}
},
"summary" : "Return car sale summary",
"tags" : [ "cars" ]
}
},
"/cars/summary" : {
"get" : {
"consumes" : [ "List" ],
"description" : "",
"operationId" : "getSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"$ref" : "#/definitions/Car_Summary"
}
}
},
"summary" : "Return car summaries",
"tags" : [ "cars" ]
}
},
"/widgets/{widgetId}" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "Returns a pet when ID <= 10. ID > 10 or nonintegers will simulate API error conditions",
"operationId" : "getWidget",
"parameters" : [ {
"in" : "path",
"name" : "widgetId",
"required" : true,
"type" : "string"
} ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Returns widget with matching id"
}
},
"summary" : "Find pet by ID",
"tags" : [ "widgets" ]
}
}
},
"swagger" : "2.0",
"tags" : [ {
"name" : "cars"
}, {
"name" : "widgets"
} ]
}]]]>
</message>
<full-stacktrace>
<![CDATA[java.lang.AssertionError: expected [{
"definitions" : {
"Car" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Detail" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire_Detail"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Summary" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
}
},
"type" : "object"
},
"Car_Summary-or-Sale" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
}
},
"type" : "object"
},
"Tire" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Tire_Detail" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Widget" : {
"properties" : {
"a" : {
"type" : "string"
},
"b" : {
"type" : "string"
},
"id" : {
"type" : "string"
}
},
"type" : "object"
}
},
"paths" : {
"/cars/all" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getAll",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return whole car",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car"
},
"type" : "array"
}
}
},
"summary" : "Return whole car",
"tags" : [ "cars" ]
}
},
"/cars/detail" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getDetails",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return car detail",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Detail"
},
"type" : "array"
}
}
},
"summary" : "Return car detail",
"tags" : [ "cars" ]
}
},
"/cars/sale" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getSaleSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Summary-or-Sale"
},
"type" : "array"
}
}
},
"summary" : "Return car sale summary",
"tags" : [ "cars" ]
}
},
"/cars/summary" : {
"get" : {
"consumes" : [ "List" ],
"description" : "",
"operationId" : "getSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"$ref" : "#/definitions/Car_Summary"
}
}
},
"summary" : "Return car summaries",
"tags" : [ "cars" ]
}
},
"/widgets/{widgetId}" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "Returns a pet when ID <= 10. ID > 10 or nonintegers will simulate API error conditions",
"operationId" : "getWidget",
"parameters" : [ {
"in" : "path",
"name" : "widgetId",
"required" : true,
"type" : "string"
} ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Returns widget with matching id"
}
},
"summary" : "Find pet by ID",
"tags" : [ "widgets" ]
}
}
},
"swagger" : "2.0",
"tags" : [ {
"name" : "cars"
}, {
"name" : "widgets"
} ]
}] but found [{
"definitions" : {
"Car" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Detail" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire_Detail"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Summary" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
}
},
"type" : "object"
},
"Car_Summary-or-Sale" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
}
},
"type" : "object"
},
"Tire" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Tire_Detail" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Widget" : {
"properties" : {
"a" : {
"type" : "string"
},
"b" : {
"type" : "string"
},
"id" : {
"type" : "string"
}
},
"type" : "object"
}
},
"paths" : {
"/cars/all" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getAll",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return whole car",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car"
},
"type" : "array"
}
}
},
"summary" : "Return whole car",
"tags" : [ "cars" ]
}
},
"/cars/detail" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getDetails",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return car detail",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Detail"
},
"type" : "array"
}
}
},
"summary" : "Return car detail",
"tags" : [ "cars" ]
}
},
"/cars/sale" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getSaleSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Summary-or-Sale"
},
"type" : "array"
}
}
},
"summary" : "Return car sale summary",
"tags" : [ "cars" ]
}
},
"/cars/summary" : {
"get" : {
"consumes" : [ "List" ],
"description" : "",
"operationId" : "getSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"$ref" : "#/definitions/Car_Summary"
}
}
},
"summary" : "Return car summaries",
"tags" : [ "cars" ]
}
},
"/widgets/{widgetId}" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "Returns a pet when ID <= 10. ID > 10 or nonintegers will simulate API error conditions",
"operationId" : "getWidget",
"parameters" : [ {
"in" : "path",
"name" : "widgetId",
"required" : true,
"type" : "string"
} ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Returns widget with matching id"
}
},
"summary" : "Find pet by ID",
"tags" : [ "widgets" ]
}
}
},
"swagger" : "2.0",
"tags" : [ {
"name" : "cars"
}, {
"name" : "widgets"
} ]
}]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:513)
at org.testng.Assert.assertEqualsImpl(Assert.java:135)
at org.testng.Assert.assertEquals(Assert.java:116)
at org.testng.Assert.assertEquals(Assert.java:190)
at org.testng.Assert.assertEquals(Assert.java:200)
at io.swagger.functional.test.ApiListingResourceIT.testSwaggerJson(ApiListingResourceIT.java:458)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:756)
at org.testng.TestRunner.run(TestRunner.java:610)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
at org.testng.TestNG.runSuites(TestNG.java:1133)
at org.testng.TestNG.run(TestNG.java:1104)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeSingleClass(TestNGDirectoryTestSuite.java:112)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
]]>
</full-stacktrace>
</exception> <!-- java.lang.AssertionError -->
<reporter-output>
</reporter-output>
</test-method> <!-- testSwaggerJson -->
<test-method status="PASS" signature="checkJetty()[pri:0, instance:io.swagger.functional.test.ApiListingResourceIT@48fa0f47]" name="checkJetty" is-config="true" duration-ms="0" started-at="2018-03-07T15:11:40Z" finished-at="2018-03-07T15:11:40Z">
<reporter-output>
</reporter-output>
</test-method> <!-- checkJetty -->
<test-method status="FAIL" signature="testSwaggerJsonUsingAcceptHeader()[pri:0, instance:io.swagger.functional.test.ApiListingResourceIT@48fa0f47]" name="testSwaggerJsonUsingAcceptHeader" duration-ms="29" started-at="2018-03-07T15:11:40Z" finished-at="2018-03-07T15:11:40Z">
<exception class="java.lang.AssertionError">
<message>
<![CDATA[expected [{
"definitions" : {
"Car" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Detail" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire_Detail"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Summary" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
}
},
"type" : "object"
},
"Car_Summary-or-Sale" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
}
},
"type" : "object"
},
"Tire" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Tire_Detail" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Widget" : {
"properties" : {
"a" : {
"type" : "string"
},
"b" : {
"type" : "string"
},
"id" : {
"type" : "string"
}
},
"type" : "object"
}
},
"paths" : {
"/cars/all" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getAll",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return whole car",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car"
},
"type" : "array"
}
}
},
"summary" : "Return whole car",
"tags" : [ "cars" ]
}
},
"/cars/detail" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getDetails",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return car detail",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Detail"
},
"type" : "array"
}
}
},
"summary" : "Return car detail",
"tags" : [ "cars" ]
}
},
"/cars/sale" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getSaleSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Summary-or-Sale"
},
"type" : "array"
}
}
},
"summary" : "Return car sale summary",
"tags" : [ "cars" ]
}
},
"/cars/summary" : {
"get" : {
"consumes" : [ "List" ],
"description" : "",
"operationId" : "getSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"$ref" : "#/definitions/Car_Summary"
}
}
},
"summary" : "Return car summaries",
"tags" : [ "cars" ]
}
},
"/widgets/{widgetId}" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "Returns a pet when ID <= 10. ID > 10 or nonintegers will simulate API error conditions",
"operationId" : "getWidget",
"parameters" : [ {
"in" : "path",
"name" : "widgetId",
"required" : true,
"type" : "string"
} ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Returns widget with matching id"
}
},
"summary" : "Find pet by ID",
"tags" : [ "widgets" ]
}
}
},
"swagger" : "2.0",
"tags" : [ {
"name" : "cars"
}, {
"name" : "widgets"
} ]
}] but found [{
"definitions" : {
"Car" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Detail" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire_Detail"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Summary" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
}
},
"type" : "object"
},
"Car_Summary-or-Sale" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
}
},
"type" : "object"
},
"Tire" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Tire_Detail" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Widget" : {
"properties" : {
"a" : {
"type" : "string"
},
"b" : {
"type" : "string"
},
"id" : {
"type" : "string"
}
},
"type" : "object"
}
},
"paths" : {
"/cars/all" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getAll",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return whole car",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car"
},
"type" : "array"
}
}
},
"summary" : "Return whole car",
"tags" : [ "cars" ]
}
},
"/cars/detail" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getDetails",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return car detail",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Detail"
},
"type" : "array"
}
}
},
"summary" : "Return car detail",
"tags" : [ "cars" ]
}
},
"/cars/sale" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getSaleSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Summary-or-Sale"
},
"type" : "array"
}
}
},
"summary" : "Return car sale summary",
"tags" : [ "cars" ]
}
},
"/cars/summary" : {
"get" : {
"consumes" : [ "List" ],
"description" : "",
"operationId" : "getSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"$ref" : "#/definitions/Car_Summary"
}
}
},
"summary" : "Return car summaries",
"tags" : [ "cars" ]
}
},
"/widgets/{widgetId}" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "Returns a pet when ID <= 10. ID > 10 or nonintegers will simulate API error conditions",
"operationId" : "getWidget",
"parameters" : [ {
"in" : "path",
"name" : "widgetId",
"required" : true,
"type" : "string"
} ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Returns widget with matching id"
}
},
"summary" : "Find pet by ID",
"tags" : [ "widgets" ]
}
}
},
"swagger" : "2.0",
"tags" : [ {
"name" : "cars"
}, {
"name" : "widgets"
} ]
}]]]>
</message>
<full-stacktrace>
<![CDATA[java.lang.AssertionError: expected [{
"definitions" : {
"Car" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Detail" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire_Detail"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Summary" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
}
},
"type" : "object"
},
"Car_Summary-or-Sale" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
}
},
"type" : "object"
},
"Tire" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Tire_Detail" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Widget" : {
"properties" : {
"a" : {
"type" : "string"
},
"b" : {
"type" : "string"
},
"id" : {
"type" : "string"
}
},
"type" : "object"
}
},
"paths" : {
"/cars/all" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getAll",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return whole car",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car"
},
"type" : "array"
}
}
},
"summary" : "Return whole car",
"tags" : [ "cars" ]
}
},
"/cars/detail" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getDetails",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return car detail",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Detail"
},
"type" : "array"
}
}
},
"summary" : "Return car detail",
"tags" : [ "cars" ]
}
},
"/cars/sale" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getSaleSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Summary-or-Sale"
},
"type" : "array"
}
}
},
"summary" : "Return car sale summary",
"tags" : [ "cars" ]
}
},
"/cars/summary" : {
"get" : {
"consumes" : [ "List" ],
"description" : "",
"operationId" : "getSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"$ref" : "#/definitions/Car_Summary"
}
}
},
"summary" : "Return car summaries",
"tags" : [ "cars" ]
}
},
"/widgets/{widgetId}" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "Returns a pet when ID <= 10. ID > 10 or nonintegers will simulate API error conditions",
"operationId" : "getWidget",
"parameters" : [ {
"in" : "path",
"name" : "widgetId",
"required" : true,
"type" : "string"
} ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Returns widget with matching id"
}
},
"summary" : "Find pet by ID",
"tags" : [ "widgets" ]
}
}
},
"swagger" : "2.0",
"tags" : [ {
"name" : "cars"
}, {
"name" : "widgets"
} ]
}] but found [{
"definitions" : {
"Car" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Detail" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"tires" : {
"items" : {
"$ref" : "#/definitions/Tire_Detail"
},
"type" : "array"
}
},
"type" : "object"
},
"Car_Summary" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
}
},
"type" : "object"
},
"Car_Summary-or-Sale" : {
"properties" : {
"color" : {
"type" : "string"
},
"manufacture" : {
"type" : "string"
},
"model" : {
"type" : "string"
},
"price" : {
"format" : "int32",
"type" : "integer"
}
},
"type" : "object"
},
"Tire" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Tire_Detail" : {
"properties" : {
"brand" : {
"type" : "string"
},
"condition" : {
"type" : "string"
}
},
"type" : "object"
},
"Widget" : {
"properties" : {
"a" : {
"type" : "string"
},
"b" : {
"type" : "string"
},
"id" : {
"type" : "string"
}
},
"type" : "object"
}
},
"paths" : {
"/cars/all" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getAll",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return whole car",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car"
},
"type" : "array"
}
}
},
"summary" : "Return whole car",
"tags" : [ "cars" ]
}
},
"/cars/detail" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getDetails",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Return car detail",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Detail"
},
"type" : "array"
}
}
},
"summary" : "Return car detail",
"tags" : [ "cars" ]
}
},
"/cars/sale" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "",
"operationId" : "getSaleSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"items" : {
"$ref" : "#/definitions/Car_Summary-or-Sale"
},
"type" : "array"
}
}
},
"summary" : "Return car sale summary",
"tags" : [ "cars" ]
}
},
"/cars/summary" : {
"get" : {
"consumes" : [ "List" ],
"description" : "",
"operationId" : "getSummaries",
"parameters" : [ ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "successful operation",
"schema" : {
"$ref" : "#/definitions/Car_Summary"
}
}
},
"summary" : "Return car summaries",
"tags" : [ "cars" ]
}
},
"/widgets/{widgetId}" : {
"get" : {
"consumes" : [ "application/json" ],
"description" : "Returns a pet when ID <= 10. ID > 10 or nonintegers will simulate API error conditions",
"operationId" : "getWidget",
"parameters" : [ {
"in" : "path",
"name" : "widgetId",
"required" : true,
"type" : "string"
} ],
"produces" : [ "application/json" ],
"responses" : {
"200" : {
"description" : "Returns widget with matching id"
}
},
"summary" : "Find pet by ID",
"tags" : [ "widgets" ]
}
}
},
"swagger" : "2.0",
"tags" : [ {
"name" : "cars"
}, {
"name" : "widgets"
} ]
}]
at org.testng.Assert.fail(Assert.java:94)
at org.testng.Assert.failNotEquals(Assert.java:513)
at org.testng.Assert.assertEqualsImpl(Assert.java:135)
at org.testng.Assert.assertEquals(Assert.java:116)
at org.testng.Assert.assertEquals(Assert.java:190)
at org.testng.Assert.assertEquals(Assert.java:200)
at io.swagger.functional.test.ApiListingResourceIT.testSwaggerJsonUsingAcceptHeader(ApiListingResourceIT.java:476)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:756)
at org.testng.TestRunner.run(TestRunner.java:610)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
at org.testng.TestNG.runSuites(TestNG.java:1133)
at org.testng.TestNG.run(TestNG.java:1104)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeSingleClass(TestNGDirectoryTestSuite.java:112)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
]]>
</full-stacktrace>
</exception> <!-- java.lang.AssertionError -->
<reporter-output>
</reporter-output>
</test-method> <!-- testSwaggerJsonUsingAcceptHeader -->
<test-method status="PASS" signature="checkJetty()[pri:0, instance:io.swagger.functional.test.ApiListingResourceIT@48fa0f47]" name="checkJetty" is-config="true" duration-ms="0" started-at="2018-03-07T15:11:40Z" finished-at="2018-03-07T15:11:40Z">
<reporter-output>
</reporter-output>
</test-method> <!-- checkJetty -->
<test-method status="PASS" signature="testSwaggerYaml()[pri:0, instance:io.swagger.functional.test.ApiListingResourceIT@48fa0f47]" name="testSwaggerYaml" duration-ms="158" started-at="2018-03-07T15:11:40Z" finished-at="2018-03-07T15:11:40Z">
<reporter-output>
</reporter-output>
</test-method> <!-- testSwaggerYaml -->
<test-method status="PASS" signature="checkJetty()[pri:0, instance:io.swagger.functional.test.ApiListingResourceIT@48fa0f47]" name="checkJetty" is-config="true" duration-ms="0" started-at="2018-03-07T15:11:40Z" finished-at="2018-03-07T15:11:40Z">
<reporter-output>
</reporter-output>
</test-method> <!-- checkJetty -->
<test-method status="PASS" signature="testSwaggerYamlUsingAcceptHeader()[pri:0, instance:io.swagger.functional.test.ApiListingResourceIT@48fa0f47]" name="testSwaggerYamlUsingAcceptHeader" duration-ms="41" started-at="2018-03-07T15:11:40Z" finished-at="2018-03-07T15:11:40Z">
<reporter-output>
</reporter-output>
</test-method> <!-- testSwaggerYamlUsingAcceptHeader -->
</class> <!-- io.swagger.functional.test.ApiListingResourceIT -->
</test> <!-- Surefire test -->
</suite> <!-- Surefire suite -->
</testng-results>
We have not been able to reproduce this, could you share your environment and any significant detail? e.g OS, java version, maven version, branch being built.
Also please try with ./mvnw install and see if you get the same error.
Running mvnw install still results in the above test failures. My environment details are:
- OS: Windows 10 Pro version 1703
- Java Version: 1.8.0 update 151
- Maven Version: 3.5.2
- Branch: master
Let me know if there's any other details you want.
I noticed that the failed tests only run for mvn install. Running mvn package still runs the main test suite with 143 tests but skips the 4 tests above.
I've ran the swagger-jaxrs jar I generated using mvn package and everything seems to be working properly. Maybe I'm getting a false-positive?
it seems a bit weird actually, I couldn't find any way to reproduce, also line numbers in stack trace seem to be wrong, are you running maven from command line? also do you get the same by running mvn clean install?
I am running maven from the command line and mvn clean install produces the same result. I also tried both at the root level and at modules/swagger-jaxrs but there was no change. I checked the testing-results.xml file I generated with mvn clean install and compared it to what I posted above. Both files are identical minus the expected differences in runtimes.
the plot thickens.. we could possibly get some additional hint by running ./mvnw -U -e -X clean install from project root, can you try and share the (huge) output as a file?
Are you able to tell me specifically what you'd be looking for? There's a decent amount of sensitive information in that output.
Issue found and fixed in #2708, please give it a try, thanks for reporting this