Updating samples after #5232. (#5243)

* Updating samples after #5232.

* Fix tests after #5232.

* Fix Javascript client tests.

* JaxRS server: set serverPort only when not given from outside.

* Update JaxRS sample creator scripts to fix serverPort.

* Preliminary test fix for JaxRS server generators.

* Updating samples for JaxRS with Jersey1/2.

* Updating JaxRS samples again.
This commit is contained in:
Paŭlo Ebermann
2017-03-29 19:28:53 +02:00
committed by wing328
parent 2830fb1794
commit db71d97370
108 changed files with 129 additions and 129 deletions

View File

@@ -10,7 +10,7 @@ describe('ApiClient', function() {
describe('defaults', function() {
it('should have correct default values with the default API client', function() {
expect(apiClient).to.be.ok();
expect(apiClient.basePath).to.be('http://petstore.swagger.io/v2');
expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2');
expect(apiClient.authentications).to.eql({
petstore_auth: {type: 'oauth2'},
http_basic_test: {type: 'basic'},
@@ -45,8 +45,8 @@ describe('ApiClient', function() {
it('should have correct default values with new API client and can customize it', function() {
var newClient = new SwaggerPetstore.ApiClient;
expect(newClient.basePath).to.be('http://petstore.swagger.io/v2');
expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io/v2/abc');
expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2');
expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc');
newClient.basePath = 'http://example.com';
expect(newClient.basePath).to.be('http://example.com');
@@ -102,16 +102,16 @@ describe('ApiClient', function() {
describe('#buildUrl', function() {
it('should work without path parameters in the path', function() {
expect(apiClient.buildUrl('/abc', {})).to
.be('http://petstore.swagger.io/v2/abc');
.be('http://petstore.swagger.io:80/v2/abc');
expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to
.be('http://petstore.swagger.io/v2/abc/def?ok');
.be('http://petstore.swagger.io:80/v2/abc/def?ok');
});
it('should work with path parameters in the path', function() {
expect(apiClient.buildUrl('/{id}', {id: 123})).to
.be('http://petstore.swagger.io/v2/123');
.be('http://petstore.swagger.io:80/v2/123');
expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to.
be('http://petstore.swagger.io/v2/abc/456/a%20b?ok');
be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok');
});
});