Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy do I get 302 HTTP status codes when I run my Scala test on Jenkins instead of 204?
    primarykey
    data
    text
    <p>I have some tests of a REST API service that I've written in Scala. We're importing <code>org.apache.http</code> and using simple HTTP method such as:</p> <pre><code>val uri: HttpGet = new HttpGet(u) val response: HttpResponse = http.execute(uri) </code></pre> <p>They go to URL such as:</p> <p><code>https://platform.company.com:443/ajax_request/login?username=me@company.com&amp;password=pass</code></p> <p>or</p> <p><code>https://admin-platform.company.com:443/usergroups/rest/usergroups</code></p> <p>The tests are compiled with Maven and run on a Jenkins ver. 1.494 server.</p> <p>The problem is that while the tests run flawlessly locally (when I do a <code>mvn clean test</code> on my laptop), they get unexpected status codes on the CI server. Locally I get 204, 200, 200, and 200 for these tests. But on CI I get 302, 302, 302, 200.</p> <p>Do I need a special configuration option in Jenkins? Or a better authentication method?</p> <p>I am able to successfully run cURL commands on the CI server itself, so I don't think it's a fundamental network connectivity issue, e.g.:</p> <pre><code>Running script : #!/bin/bash # get an auth session curl -v -b cookies.txt -c cookies.txt -L "https://platform.company.com/ajax_request/login? username=user&amp;password=pass" # get a list of company guids curl -v -b cookies.txt -c cookies.txt -L "https://platform.company.com/ajax_request/companies_selector" # run this to make a call to service for company: curl -v -b cookies.txt -c cookies.txt --cookie "company_guid=3f65b34d-b6f4-4abd-b14b-408b8a11059b" -L "https://service-platform.company.com/users" </code></pre> <p>Ideas? Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload