Add validation on route FindCitizens
This commit is contained in:
@@ -26,7 +26,7 @@ class `Citizen routes` : BaseTest() {
|
||||
fun `I can get Citizens information`() {
|
||||
withIntegrationApplication {
|
||||
`Given I have citizen`("Jean", "Perrin", id = "5267a5c6-af42-4a02-aa2b-6b71d2e43973")
|
||||
`When I send a GET request`("/citizens") {
|
||||
`When I send a GET request`("/citizens?page=1&limit=5&sort=createdAt") {
|
||||
`authenticated as`("Jean", "Perrin")
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`()
|
||||
@@ -34,6 +34,19 @@ class `Citizen routes` : BaseTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Tag("BadRequest")
|
||||
fun `I cannot get Citizens information with wrong request`() {
|
||||
withIntegrationApplication {
|
||||
`Given I have citizen`("Jean", "Perrin", id = "5267a5c6-af42-4a02-aa2b-6b71d2e43973")
|
||||
`When I send a GET request`("/citizens?page=1&limit=5&sort=created_at", Validate.ALL - Validate.REQUEST_PARAM) {
|
||||
`authenticated as`("Jean", "Perrin")
|
||||
} `Then the response should be` BadRequest and {
|
||||
`And the response should not be null`()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `I can get specific Citizen information`() {
|
||||
withIntegrationApplication {
|
||||
|
||||
Reference in New Issue
Block a user