Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If any auth type is used and host connection is refused during any REST call in a scenario, then following scenario is failing with 404 and connection is getting closed #141

Open
chandra-mummidi opened this issue Jun 14, 2018 · 0 comments

Comments

@chandra-mummidi
Copy link

chandra-mummidi commented Jun 14, 2018

I'm using cukes-rest-sample project and using the "cukes.auth_type" property as "cukes.auth_type=basic" in cukes.properties file. In this case below code gets executed in "HttpResponseFacade.java" class:
if ($type.get().equalsIgnoreCase("BASIC")) {
authBasic();
}

When this code is executed, and host connection for any REST call (GET, POST) is refused, following scenario in the same feature file gets failed with 404 status.

Below are the detailed logs:

Scenario-1:
Request method: GET

Body:
Request params:
Query params:
Form params:
Path params:
Multiparts:

Request URI: https://hostname.com/gadgets

@positive @testing
Scenario: test one # features/gadgets/Create Gadgets.feature:33
When the client performs GET request on "https://hostname.com/gadgets" # WhenSteps.perform_Http_Request(String,String)
java.net.ConnectException: Connection refused: connect

Scenario -2:
Request method: GET

Body:
Request params:
Query params:
Form params:
Path params:
Multiparts:

Request URI: https://<valid end point - hidden>

Server: nginx/1.13.8
Date: Thu, 14 Jun 2018 03:25:04 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 173
Connection: close

<title>400 Bad Request</title>

400 Bad Request


nginx/1.13.8 HTTP/1.1 400 Bad Request

===========
You can notice that "Connection: close" in the second scenario though the endpoint is reachable.
However, if I don't use "cukes.auth_type" property (comment), second scenario runs successfully, and we can see "Connection: keep-alive".

Steps to reproduce:
This is very easy to reproduce.

  1. Update "cukes.auth_type=basic" in cukes.properties file
  2. Feature file will have 2 scenario, with first scenario being any REST call on a non-reachable host, and second scenario being any REST call on a reachable host

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant