sahaya / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Incorrect port is being used #217

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt to use a nonstandard port, eg 8080
given().port(8080).expect().statusCode(200).when().get("");
2. Tried both inline and with  RestAssured.port = 8080;       
3. For both types additional configuration is:

    RestAssured.baseURI = "http://localhost/";
        RestAssured.port = 8080;                
        RestAssured.basePath = "/api";

What is the expected output? What do you see instead?
Expected that it would try to call the host with 8080, instead it defaults to 
80.

0    [main] DEBUG org.apache.http.impl.conn.BasicClientConnectionManager  - Get 
connection for route {}->http://localhost
31   [main] DEBUG org.apache.http.impl.conn.DefaultClientConnectionOperator  - 
Connecting to localhost:80
968  [main] DEBUG org.apache.http.impl.conn.DefaultClientConnection  - 
Connection org.apache.http.impl.conn.DefaultClientConnection@6545d2 closed
968  [main] DEBUG org.apache.http.impl.conn.DefaultClientConnection  - 
Connection org.apache.http.impl.conn.DefaultClientConnection@6545d2 shut down

What version of the product are you using? On what operating system?
Rest Assured 1.7.2, JDK 1.6, TestNG, Win XP

Please provide any additional information below.
Using Gradle for dependencies:
 compile group: 'com.jayway.restassured', name: 'rest-assured', version: '1.7.2'
    compile group: 'commons-io', name: 'commons-io', version: '1.4'
    compile group: 'log4j', name: 'log4j', version: '1.2.15', ext: 'jar'
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1', ext: 'jar'
    compile group: 'org.springframework', name: 'spring-web', version: '3.1.2.RELEASE'
    compile group: 'org.springframework', name: 'spring-beans', version: '3.1.2.RELEASE', ext: 'jar'
    compile group: 'org.springframework', name: 'spring-mock', version: '2.0.8', ext: 'jar'
    compile group: 'org.springframework', name: 'spring-test', version: '3.1.2.RELEASE', ext: 'jar'
    compile group: 'org.springframework.integration', name: 'spring-integration-core', version: '2.2.0.RELEASE'
    compile group: 'org.springframework.integration', name: 'spring-integration-http', version: '2.2.0.RELEASE'
    compile group: 'org.springframework', name: 'org.springframework.context', version: '3.1.2.RELEASE', ext: 'jar'
    compile group: 'org.springframework', name: 'spring-webmvc', version: '3.1.2.RELEASE'
    compile group: 'org.springframework.data', name: 'spring-data-mongodb', version: '1.1.2.RELEASE'

    compile group: 'javax.servlet', name: 'servlet-api', version: '2.5', ext: 'jar'
    compile group: 'org.codehaus.jackson', name: 'jackson-mapper-asl', version: '1.9.5'
    compile group: 'com.google.code.gson', name: 'gson', version: '2.2.2', ext: 'jar'
    compile group: 'org.jasypt', name: 'jasypt', version: '1.9.0', ext: 'jar'
    runtime group: 'org.hamcrest', name: 'hamcrest-library', version: '1.2.1', ext: 'jar'
    runtime group: 'org.hamcrest', name: 'hamcrest-core', version: '1.2.1', ext: 'jar'
    runtime group: 'org.apache.httpcomponents', name:'httpclient', version: '4.1.3'
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1', ext: 'jar'

    testCompile 'org.testng:testng:6.3.1'   

Original issue reported on code.google.com by peteb...@gmail.com on 15 Feb 2013 at 3:57

GoogleCodeExporter commented 9 years ago
I've now fixed this in master, to try it out depend on version 1.8.2-SNAPSHOT 
after having added the following Maven repo:

<repositories>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots />
        </repository>
</repositories>

Original comment by johan.ha...@gmail.com on 20 Nov 2013 at 10:24