GitHub - RobWin/assertj-swagger: A Swagger assertj test library which compares a contract-first Swagger YAML/JSON file with a code-first Swagger JSON (original) (raw)
For Documentation Driven Contract tests, Assertj-swagger fails a test if it finds differences between the implementation and the specification.
The following 4 assertions failed:
1) [Checking Paths]
Expecting:
<["/api/pet", "/api/pet/findByStatus", "/api/pet/findByTags", "/api/pet/{petId}", "/api/store/order", "/api/store/order/{orderId}", "/api/user", "/api/user/createWithArray", "/api/user/createWithList", "/api/user/login", "/api/user/logout", "/api/user/{username}"]>
to contain only:
<["/pets", "/pets/findByStatus", "/pets/findByTags", "/pets/{petId}", "/stores/order", "/stores/order/{orderId}", "/users", "/users/createWithArray", "/users/createWithList", "/users/login", "/users/logout", "/users/{username}"]>
elements not found:
<["/pets/findByTags", "/users/logout", "/users", "/stores/order", "/users/createWithArray", "/pets", "/users/createWithList", "/pets/findByStatus", "/pets/{petId}", "/users/{username}", "/stores/order/{orderId}", "/users/login"]>
and elements not expected:
<["/api/store/order", "/api/user", "/api/user/createWithList", "/api/pet", "/api/pet/findByTags", "/api/user/createWithArray", "/api/user/login", "/api/pet/{petId}", "/api/store/order/{orderId}", "/api/user/{username}", "/api/pet/findByStatus", "/api/user/logout"]>
2) [Checking properties of definition 'Order']
Expecting:
<["complete", "id", "identifier", "petId", "quantity", "shipDate", "status"]>
to contain only:
<["id", "petId", "quantity", "shipDate", "status", "complete"]>
elements not found:
<[]>
and elements not expected:
<["identifier"]>
3) [Checking properties of definition 'User']
Expecting:
<["email", "firstName", "id", "identifier", "lastName", "password", "phone", "userStatus", "username"]>
to contain only:
<["id", "username", "firstName", "lastName", "email", "password", "phone", "userStatus"]>
elements not found:
<[]>
and elements not expected:
<["identifier"]>
4) [Checking properties of definition 'Pet']
Expecting:
<["category", "id", "identifier", "name", "photoUrls", "status", "tags"]>
to contain only:
<["id", "category", "name", "photoUrls", "tags", "status"]>
elements not found:
<[]>
and elements not expected:
<["identifier"]>
For Consumer Driven Contract tests, Assertj-swagger fails a test if it finds missing resources, methods, models, or properties in the implementation which are required by the consumer specification.
The following 4 assertions failed:
1) [Checking Paths]
Expecting:
<["/pets", "/pets/findByStatus", "/pets/findByTags", "/pets/{petId}", "/stores/order", "/stores/order/{orderId}", "/users", "/users/createWithArray", "/users/createWithList", "/users/login", "/users/logout", "/users/{username}"]>
to contain:
<["/animals/{animalId}", "/pets", "/pets/findByStatus", "/pets/{petId}"]>
but could not find:
<["/animals/{animalId}"]>
2) [Checking Definitions]
Expecting:
<["User", "Category", "Pet", "Tag", "Order"]>
to contain:
<["Category", "Pet", "Animal", "Tag"]>
but could not find:
<["Animal"]>
3) [Checking properties of definition 'Pet']
Expecting:
<["id", "category", "name", "photoUrls", "tags", "status"]>
to contain:
<["photoUrls", "extraProperty", "name", "id", "category", "tags", "status"]>
but could not find:
<["extraProperty"]>
4) [Checking property 'extraProperty' of definition 'Pet']
Expecting actual not to be null