-
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.
test les réponses http des endpoints DTS avec github CI
- Loading branch information
1 parent
2d25775
commit 1b99a9f
Showing
3 changed files
with
28 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
xquery version '3.0' ; | ||
|
||
module namespace initTests = "https://github.com/chartes/dots/initTests"; | ||
|
||
declare function initTests:endpoint($url) { | ||
let $statutCode := http:send-request(<http:request method='get' status-only='true'/>, $url) | ||
return | ||
normalize-space($statutCode/@status) | ||
}; | ||
|
||
declare %unit:test function initTests:check-value-response200($url) { | ||
let $expected := "200" | ||
return | ||
unit:assert-equals(initTests:endpoint($url), $expected) | ||
}; | ||
|
||
declare %unit:test function initTests:check-value-response400($url) { | ||
let $expected := "400" | ||
return | ||
unit:assert-equals(initTests:endpoint($url), $expected) | ||
}; |
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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
xquery version '3.0' ; | ||
|
||
import module namespace test = "https://github.com/chartes/dots/tests" at "utilsTest.xqm"; | ||
import module namespace initTests = "https://github.com/chartes/dots/initTests" at "initTestsEndpoint.xqm"; | ||
|
||
|
||
(: :) | ||
test:check-metadata-output() | ||
initTests:check-value-response200("http://localhost:8080/api/dts"), | ||
initTests:check-value-response200("http://localhost:8080/api/dts/collection"), | ||
initTests:check-value-response400("http://localhost:8080/api/dts/navigation"), | ||
initTests:check-value-response400("http://localhost:8080/api/dts/document") | ||
|