-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add type inside response, update tests and doc
- Loading branch information
Showing
11 changed files
with
183 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
test/integration/mocha/requests/integrationHealthRequest.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const assert = require('assert'); | ||
const HealthRequest = require('../../../../src/js/requests/healthRequest'); | ||
const logManager = require('../logManager'); | ||
|
||
describe('Test de la classe HealthRequest', function() { | ||
|
||
before(function() { | ||
// runs before all tests in this block | ||
logManager.manageLogs(); | ||
}); | ||
|
||
let request = new HealthRequest(); | ||
|
||
describe('Test du constructeur et des getters/setters', function() { | ||
|
||
it('Get type', function() { | ||
assert.equal(request.type, "healthRequest"); | ||
}); | ||
|
||
it('Get verbose', function() { | ||
assert.equal(request.verbose, false); | ||
}); | ||
|
||
it('Set verbose', function() { | ||
request.verbose = true; | ||
assert.equal(request.verbose, true); | ||
}); | ||
|
||
}); | ||
|
||
}); |
49 changes: 49 additions & 0 deletions
49
test/integration/mocha/responses/integrationHealthResponse.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const assert = require('assert'); | ||
const HealthResponse = require('../../../../src/js/requests/healthResponse'); | ||
const logManager = require('../logManager'); | ||
|
||
describe('Test de la classe HealthResponse', function() { | ||
|
||
before(function() { | ||
// runs before all tests in this block | ||
logManager.manageLogs(); | ||
}); | ||
|
||
let response = new HealthResponse(); | ||
|
||
describe('Test du constructeur et des getters/setters', function() { | ||
|
||
it('Get type', function() { | ||
assert.equal(response.type, "healthResponse"); | ||
}); | ||
|
||
it('Get globalState', function() { | ||
assert.equal(response.globalState, "unknown"); | ||
}); | ||
|
||
it('Set globalState', function() { | ||
response.globalState = "green"; | ||
assert.equal(response.globalState, "green"); | ||
}); | ||
|
||
it('Get adminState', function() { | ||
assert.equal(response.adminState, "unknown"); | ||
}); | ||
|
||
it('Set adminState', function() { | ||
response.adminState = "green"; | ||
assert.equal(response.adminState, "green"); | ||
}); | ||
|
||
it('Get serviceStates', function() { | ||
assert.deepEqual(response.serviceStates, new Array()); | ||
}); | ||
|
||
it('Set serviceStates', function() { | ||
response.serviceStates.push = {"serviceId":"unknown","state":"green"}; | ||
assert.deepEqual(response.serviceStates[0], {"serviceId":"unknown","state":"green"}); | ||
}); | ||
|
||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters