authorjapps / zerocode

A community-developed, free, opensource, automated testing framework for microservices APIs, Kafka(Data Streams) and Load testing. Zerocode Open Source enables you to create, change and maintain your automated test scenarios via simple JSON or YAML files. Visit documentation below:
https://zerocode-tdd.tddfy.com
Apache License 2.0
887 stars 389 forks source link

TECH-DEBT - Upgrade to version 1.58 version of WireMock #49

Closed authorjapps closed 5 years ago

authorjapps commented 6 years ago

Review Comment at PR by @nirmalchandra .

can you upgrade to <version>1.58</version> to see if the port is not repeated?
You can have as a tech-debt.
authorjapps commented 5 years ago

@arunvelusamyd has upgraded to latest version <wiremock.version>2.19.0</wiremock.version>

PR https://github.com/authorjapps/zerocode/pull/139/files was raised to fix this issue. 👍

The new wiremock prints a nice output as below, also suggests where things went wrong.

See the below test in the repo- wiremock_integration/mock_via_wiremock_then_test_the_end_point.json

2018-10-16 23:28:59,421 [main] INFO org.jsmart.zerocode.core.httpclient.utils.HeaderUtils - Overridden the header key:api_secret, with value:secret-01-01
2018-10-16 23:28:59,431 [qtp1231006815-19] ERROR WireMock - 
                                               Request was not matched
                                               =======================

-----------------------------------------------------------------------------------------------------------------------
| Closest stub                                             | Request                                                  |
-----------------------------------------------------------------------------------------------------------------------
                                                           |
GET                                                        | GET
/api/v1/amazon/customers/cust-007                          | /api/v1/amazon/customers/cust-007
                                                           |
api_key: key-01-01                                         |                                                     <<<<< Header is not present
api_secret: secret-01-01                                   | api_secret: secret-01-01
                                                           |
                                                           |
-----------------------------------------------------------------------------------------------------------------------
authorjapps commented 5 years ago

PR has been merged now.

authorjapps commented 5 years ago

@arunvelusamyd , would you be able to put an example in this HelloWorld repo highlighting the new WireMock feature: e.g. if a header is missed while calling an end-point(which expects a header), WireMock will suggest this with a comparison table. (When you get chance please)

or

Updating this Wiki Page will also do 👍 - https://github.com/authorjapps/zerocode/wiki/Mocking-end-points-via-WireMock(Simple-and-flexible)