Skip to content

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

@chandra-mummidi

Description

@chandra-mummidi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions