From f9eaa0b843e444caf9d80ffbcf85520adf4a2ab8 Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Thu, 30 Sep 2021 01:27:14 +0200 Subject: [PATCH] Lint --- src/test/kotlin/integration/Article routes.kt | 14 +++++++------- src/test/kotlin/integration/Citizen routes.kt | 10 +++++----- .../integration/Comment articles routes.kt | 12 ++++++------ .../Comment constitutions routes.kt | 18 +++++++++--------- src/test/kotlin/integration/Comment routes.kt | 12 ++++++------ .../kotlin/integration/Constitution routes.kt | 14 +++++++------- .../integration/Follow articles routes.kt | 6 +++--- .../integration/Follow citizen routes.kt | 6 +++--- .../integration/Follow constitutions routes.kt | 6 +++--- src/test/kotlin/integration/Login routes.kt | 6 +++--- .../kotlin/integration/Notification routes.kt | 2 +- src/test/kotlin/integration/Opinion routes.kt | 12 ++++++------ src/test/kotlin/integration/Register routes.kt | 6 +++--- src/test/kotlin/integration/Vote routes.kt | 12 ++++++------ .../integration/Workgroup Members routes.kt | 10 +++++----- .../kotlin/integration/Workgroup routes.kt | 16 ++++++++-------- .../kotlin/integration/steps/then/request.kt | 2 +- 17 files changed, 82 insertions(+), 82 deletions(-) diff --git a/src/test/kotlin/integration/Article routes.kt b/src/test/kotlin/integration/Article routes.kt index 22e6123..0b41315 100644 --- a/src/test/kotlin/integration/Article routes.kt +++ b/src/test/kotlin/integration/Article routes.kt @@ -2,26 +2,26 @@ package integration import fr.dcproject.common.utils.toUUID import fr.dcproject.component.citizen.database.CitizenI.Name -import integration.steps.`when`.Validate -import integration.steps.`when`.`When I send a GET request` -import integration.steps.`when`.`When I send a POST request` -import integration.steps.`when`.`with body` -import integration.steps.given.`Given I have article created by workgroup` import integration.steps.given.`Given I have article` +import integration.steps.given.`Given I have article created by workgroup` import integration.steps.given.`Given I have articles` import integration.steps.given.`Given I have citizen` import integration.steps.given.`Given I have draft article` import integration.steps.given.`Given I have workgroup` import integration.steps.given.`authenticated as` import integration.steps.then.`And have property` +import integration.steps.then.`And the response should contain` import integration.steps.then.`And the response should contain list` import integration.steps.then.`And the response should contain pattern` -import integration.steps.then.`And the response should contain` import integration.steps.then.`And the response should not be null` import integration.steps.then.`And the response should not contain` import integration.steps.then.`Then the response should be` -import integration.steps.then.`which contains` import integration.steps.then.and +import integration.steps.then.`which contains` +import integration.steps.`when`.Validate +import integration.steps.`when`.`When I send a GET request` +import integration.steps.`when`.`When I send a POST request` +import integration.steps.`when`.`with body` import io.ktor.http.HttpStatusCode.Companion.BadRequest import io.ktor.http.HttpStatusCode.Companion.Forbidden import io.ktor.http.HttpStatusCode.Companion.NotFound diff --git a/src/test/kotlin/integration/Citizen routes.kt b/src/test/kotlin/integration/Citizen routes.kt index 95c445e..6539b5d 100644 --- a/src/test/kotlin/integration/Citizen routes.kt +++ b/src/test/kotlin/integration/Citizen routes.kt @@ -1,16 +1,16 @@ package integration -import integration.steps.`when`.Validate -import integration.steps.`when`.`When I send a GET request` -import integration.steps.`when`.`When I send a PUT request` -import integration.steps.`when`.`with body` import integration.steps.given.`Given I have citizen` import integration.steps.given.`authenticated as` import integration.steps.then.`And have property` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` -import integration.steps.then.`which contains` import integration.steps.then.and +import integration.steps.then.`which contains` +import integration.steps.`when`.Validate +import integration.steps.`when`.`When I send a GET request` +import integration.steps.`when`.`When I send a PUT request` +import integration.steps.`when`.`with body` import io.ktor.http.HttpStatusCode.Companion.BadRequest import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.OK diff --git a/src/test/kotlin/integration/Comment articles routes.kt b/src/test/kotlin/integration/Comment articles routes.kt index 517b04c..f0aebc6 100644 --- a/src/test/kotlin/integration/Comment articles routes.kt +++ b/src/test/kotlin/integration/Comment articles routes.kt @@ -1,12 +1,6 @@ package integration import fr.dcproject.component.citizen.database.CitizenI.Name -import integration.steps.`when`.Validate.ALL -import integration.steps.`when`.Validate.REQUEST_BODY -import integration.steps.`when`.Validate.REQUEST_PARAM -import integration.steps.`when`.`When I send a GET request` -import integration.steps.`when`.`When I send a POST request` -import integration.steps.`when`.`with body` import integration.steps.given.`Given I have article` import integration.steps.given.`Given I have citizen` import integration.steps.given.`Given I have comment on article` @@ -15,6 +9,12 @@ import integration.steps.then.`And the response should contain` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` import integration.steps.then.and +import integration.steps.`when`.Validate.ALL +import integration.steps.`when`.Validate.REQUEST_BODY +import integration.steps.`when`.Validate.REQUEST_PARAM +import integration.steps.`when`.`When I send a GET request` +import integration.steps.`when`.`When I send a POST request` +import integration.steps.`when`.`with body` import io.ktor.http.HttpStatusCode.Companion.BadRequest import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.OK diff --git a/src/test/kotlin/integration/Comment constitutions routes.kt b/src/test/kotlin/integration/Comment constitutions routes.kt index 523a0be..dd243b8 100644 --- a/src/test/kotlin/integration/Comment constitutions routes.kt +++ b/src/test/kotlin/integration/Comment constitutions routes.kt @@ -1,21 +1,21 @@ package integration import fr.dcproject.component.citizen.database.CitizenI.Name +import integration.steps.given.`Given I have citizen` +import integration.steps.given.`Given I have comment on constitution` +import integration.steps.given.`Given I have constitution` +import integration.steps.given.`authenticated as` +import integration.steps.then.`And the response should contain` +import integration.steps.then.`And the response should contain list` +import integration.steps.then.`And the response should not be null` +import integration.steps.then.`Then the response should be` +import integration.steps.then.and import integration.steps.`when`.Validate import integration.steps.`when`.Validate.ALL import integration.steps.`when`.Validate.REQUEST_BODY import integration.steps.`when`.`When I send a GET request` import integration.steps.`when`.`When I send a POST request` import integration.steps.`when`.`with body` -import integration.steps.given.`Given I have citizen` -import integration.steps.given.`Given I have comment on constitution` -import integration.steps.given.`Given I have constitution` -import integration.steps.given.`authenticated as` -import integration.steps.then.`And the response should contain list` -import integration.steps.then.`And the response should contain` -import integration.steps.then.`And the response should not be null` -import integration.steps.then.`Then the response should be` -import integration.steps.then.and import io.ktor.http.HttpStatusCode.Companion.BadRequest import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.OK diff --git a/src/test/kotlin/integration/Comment routes.kt b/src/test/kotlin/integration/Comment routes.kt index ad7cea7..8c855a7 100644 --- a/src/test/kotlin/integration/Comment routes.kt +++ b/src/test/kotlin/integration/Comment routes.kt @@ -1,12 +1,6 @@ package integration import fr.dcproject.component.citizen.database.CitizenI -import integration.steps.`when`.Validate.ALL -import integration.steps.`when`.Validate.REQUEST_BODY -import integration.steps.`when`.`When I send a GET request` -import integration.steps.`when`.`When I send a POST request` -import integration.steps.`when`.`When I send a PUT request` -import integration.steps.`when`.`with body` import integration.steps.given.`Given I have article` import integration.steps.given.`Given I have citizen` import integration.steps.given.`Given I have comment on article` @@ -16,6 +10,12 @@ import integration.steps.then.`And the response should contain` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` import integration.steps.then.and +import integration.steps.`when`.Validate.ALL +import integration.steps.`when`.Validate.REQUEST_BODY +import integration.steps.`when`.`When I send a GET request` +import integration.steps.`when`.`When I send a POST request` +import integration.steps.`when`.`When I send a PUT request` +import integration.steps.`when`.`with body` import io.ktor.http.HttpStatusCode.Companion.BadRequest import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.OK diff --git a/src/test/kotlin/integration/Constitution routes.kt b/src/test/kotlin/integration/Constitution routes.kt index 271ca52..29f53c2 100644 --- a/src/test/kotlin/integration/Constitution routes.kt +++ b/src/test/kotlin/integration/Constitution routes.kt @@ -1,11 +1,5 @@ package integration -import integration.steps.`when`.Validate.ALL -import integration.steps.`when`.Validate.REQUEST_BODY -import integration.steps.`when`.Validate.REQUEST_PARAM -import integration.steps.`when`.`When I send a GET request` -import integration.steps.`when`.`When I send a POST request` -import integration.steps.`when`.`with body` import integration.steps.given.`Given I have citizen` import integration.steps.given.`Given I have constitution` import integration.steps.given.`Given I have constitutions` @@ -14,8 +8,14 @@ import integration.steps.then.`And have property` import integration.steps.then.`And the response should contain` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` -import integration.steps.then.`which contains` import integration.steps.then.and +import integration.steps.then.`which contains` +import integration.steps.`when`.Validate.ALL +import integration.steps.`when`.Validate.REQUEST_BODY +import integration.steps.`when`.Validate.REQUEST_PARAM +import integration.steps.`when`.`When I send a GET request` +import integration.steps.`when`.`When I send a POST request` +import integration.steps.`when`.`with body` import io.ktor.http.HttpStatusCode.Companion.BadRequest import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.OK diff --git a/src/test/kotlin/integration/Follow articles routes.kt b/src/test/kotlin/integration/Follow articles routes.kt index 1c79b9f..b3e6e71 100644 --- a/src/test/kotlin/integration/Follow articles routes.kt +++ b/src/test/kotlin/integration/Follow articles routes.kt @@ -1,8 +1,5 @@ package integration -import integration.steps.`when`.`When I send a DELETE request` -import integration.steps.`when`.`When I send a GET request` -import integration.steps.`when`.`When I send a POST request` import integration.steps.given.`And follow article` import integration.steps.given.`Given I have article` import integration.steps.given.`Given I have citizen` @@ -13,6 +10,9 @@ import integration.steps.then.`And the response should contain` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` import integration.steps.then.and +import integration.steps.`when`.`When I send a DELETE request` +import integration.steps.`when`.`When I send a GET request` +import integration.steps.`when`.`When I send a POST request` import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.NoContent import io.ktor.http.HttpStatusCode.Companion.OK diff --git a/src/test/kotlin/integration/Follow citizen routes.kt b/src/test/kotlin/integration/Follow citizen routes.kt index 108a684..8bd7541 100644 --- a/src/test/kotlin/integration/Follow citizen routes.kt +++ b/src/test/kotlin/integration/Follow citizen routes.kt @@ -1,8 +1,5 @@ package integration -import integration.steps.`when`.`When I send a DELETE request` -import integration.steps.`when`.`When I send a GET request` -import integration.steps.`when`.`When I send a POST request` import integration.steps.given.`And follow citizen` import integration.steps.given.`Given I have citizen` import integration.steps.given.`authenticated as` @@ -12,6 +9,9 @@ import integration.steps.then.`And the response should contain` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` import integration.steps.then.and +import integration.steps.`when`.`When I send a DELETE request` +import integration.steps.`when`.`When I send a GET request` +import integration.steps.`when`.`When I send a POST request` import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.NoContent import io.ktor.http.HttpStatusCode.Companion.OK diff --git a/src/test/kotlin/integration/Follow constitutions routes.kt b/src/test/kotlin/integration/Follow constitutions routes.kt index 5c28b17..48ba39a 100644 --- a/src/test/kotlin/integration/Follow constitutions routes.kt +++ b/src/test/kotlin/integration/Follow constitutions routes.kt @@ -1,8 +1,5 @@ package integration -import integration.steps.`when`.`When I send a DELETE request` -import integration.steps.`when`.`When I send a GET request` -import integration.steps.`when`.`When I send a POST request` import integration.steps.given.`And follow constitution` import integration.steps.given.`Given I have citizen` import integration.steps.given.`Given I have constitution` @@ -13,6 +10,9 @@ import integration.steps.then.`And the response should contain` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` import integration.steps.then.and +import integration.steps.`when`.`When I send a DELETE request` +import integration.steps.`when`.`When I send a GET request` +import integration.steps.`when`.`When I send a POST request` import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.NoContent import io.ktor.http.HttpStatusCode.Companion.OK diff --git a/src/test/kotlin/integration/Login routes.kt b/src/test/kotlin/integration/Login routes.kt index 131b278..55734ef 100644 --- a/src/test/kotlin/integration/Login routes.kt +++ b/src/test/kotlin/integration/Login routes.kt @@ -1,13 +1,13 @@ package integration -import integration.steps.`when`.`When I send a POST request` -import integration.steps.`when`.`with body` import integration.steps.given.`Given I have citizen` import integration.steps.given.`authenticated as` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` -import integration.steps.then.`and should contains` import integration.steps.then.and +import integration.steps.then.`and should contains` +import integration.steps.`when`.`When I send a POST request` +import integration.steps.`when`.`with body` import io.ktor.http.HttpStatusCode.Companion.NoContent import io.ktor.http.HttpStatusCode.Companion.OK import org.junit.jupiter.api.Tag diff --git a/src/test/kotlin/integration/Notification routes.kt b/src/test/kotlin/integration/Notification routes.kt index afff34f..dfd57a5 100644 --- a/src/test/kotlin/integration/Notification routes.kt +++ b/src/test/kotlin/integration/Notification routes.kt @@ -4,8 +4,8 @@ import fr.dcproject.component.citizen.database.CitizenI.Name import fr.dcproject.component.notification.ArticleUpdateNotificationMessage import fr.dcproject.component.notification.NotificationMessage import integration.steps.given.`And follow citizen` -import integration.steps.given.`Given I have article update notification` import integration.steps.given.`Given I have article` +import integration.steps.given.`Given I have article update notification` import integration.steps.given.`Given I have citizen` import integration.steps.given.`Given I have follow on article` import integration.steps.given.`authenticated in url as` diff --git a/src/test/kotlin/integration/Opinion routes.kt b/src/test/kotlin/integration/Opinion routes.kt index 14e8d13..615e23a 100644 --- a/src/test/kotlin/integration/Opinion routes.kt +++ b/src/test/kotlin/integration/Opinion routes.kt @@ -1,21 +1,21 @@ package integration import fr.dcproject.component.citizen.database.CitizenI.Name -import integration.steps.`when`.Validate.ALL -import integration.steps.`when`.Validate.REQUEST_PARAM -import integration.steps.`when`.`When I send a GET request` -import integration.steps.`when`.`When I send a PUT request` -import integration.steps.`when`.`with body` import integration.steps.given.`Given I have an opinion choice` import integration.steps.given.`Given I have article` import integration.steps.given.`Given I have citizen` import integration.steps.given.`Given I have opinion on article` import integration.steps.given.`authenticated as` -import integration.steps.then.`And the response should contain list` import integration.steps.then.`And the response should contain` +import integration.steps.then.`And the response should contain list` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` import integration.steps.then.and +import integration.steps.`when`.Validate.ALL +import integration.steps.`when`.Validate.REQUEST_PARAM +import integration.steps.`when`.`When I send a GET request` +import integration.steps.`when`.`When I send a PUT request` +import integration.steps.`when`.`with body` import io.ktor.http.HttpStatusCode import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.OK diff --git a/src/test/kotlin/integration/Register routes.kt b/src/test/kotlin/integration/Register routes.kt index 510d0b2..ebc852b 100644 --- a/src/test/kotlin/integration/Register routes.kt +++ b/src/test/kotlin/integration/Register routes.kt @@ -1,13 +1,13 @@ package integration -import integration.steps.`when`.Validate -import integration.steps.`when`.`When I send a POST request` -import integration.steps.`when`.`with body` import integration.steps.then.`And the response should be null` import integration.steps.then.`And the response should contain pattern` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` import integration.steps.then.and +import integration.steps.`when`.Validate +import integration.steps.`when`.`When I send a POST request` +import integration.steps.`when`.`with body` import io.ktor.http.HttpStatusCode.Companion.BadRequest import io.ktor.http.HttpStatusCode.Companion.OK import org.junit.jupiter.api.Tag diff --git a/src/test/kotlin/integration/Vote routes.kt b/src/test/kotlin/integration/Vote routes.kt index a01aaf7..94e19f1 100644 --- a/src/test/kotlin/integration/Vote routes.kt +++ b/src/test/kotlin/integration/Vote routes.kt @@ -1,12 +1,6 @@ package integration import fr.dcproject.component.citizen.database.CitizenI.Name -import integration.steps.`when`.Validate.ALL -import integration.steps.`when`.Validate.REQUEST_BODY -import integration.steps.`when`.Validate.REQUEST_PARAM -import integration.steps.`when`.`When I send a GET request` -import integration.steps.`when`.`When I send a PUT request` -import integration.steps.`when`.`with body` import integration.steps.given.`Given I have article` import integration.steps.given.`Given I have citizen` import integration.steps.given.`Given I have comment on article` @@ -18,6 +12,12 @@ import integration.steps.then.`And the response should contain` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` import integration.steps.then.and +import integration.steps.`when`.Validate.ALL +import integration.steps.`when`.Validate.REQUEST_BODY +import integration.steps.`when`.Validate.REQUEST_PARAM +import integration.steps.`when`.`When I send a GET request` +import integration.steps.`when`.`When I send a PUT request` +import integration.steps.`when`.`with body` import io.ktor.http.HttpStatusCode.Companion.BadRequest import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.OK diff --git a/src/test/kotlin/integration/Workgroup Members routes.kt b/src/test/kotlin/integration/Workgroup Members routes.kt index 49034b0..064d077 100644 --- a/src/test/kotlin/integration/Workgroup Members routes.kt +++ b/src/test/kotlin/integration/Workgroup Members routes.kt @@ -1,18 +1,18 @@ package integration import fr.dcproject.component.citizen.database.CitizenI.Name -import integration.steps.`when`.`When I send a DELETE request` -import integration.steps.`when`.`When I send a POST request` -import integration.steps.`when`.`When I send a PUT request` -import integration.steps.`when`.`with body` import integration.steps.given.`Given I have citizen` import integration.steps.given.`Given I have workgroup` import integration.steps.given.`With members` import integration.steps.given.`authenticated as` -import integration.steps.then.`And the response should contain list` import integration.steps.then.`And the response should contain` +import integration.steps.then.`And the response should contain list` import integration.steps.then.`Then the response should be` import integration.steps.then.and +import integration.steps.`when`.`When I send a DELETE request` +import integration.steps.`when`.`When I send a POST request` +import integration.steps.`when`.`When I send a PUT request` +import integration.steps.`when`.`with body` import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.OK import org.junit.jupiter.api.Tag diff --git a/src/test/kotlin/integration/Workgroup routes.kt b/src/test/kotlin/integration/Workgroup routes.kt index 6a7adfb..b317a65 100644 --- a/src/test/kotlin/integration/Workgroup routes.kt +++ b/src/test/kotlin/integration/Workgroup routes.kt @@ -1,13 +1,6 @@ package integration import fr.dcproject.component.citizen.database.CitizenI.Name -import integration.steps.`when`.Validate.REQUEST_BODY -import integration.steps.`when`.Validate.REQUEST_PARAM -import integration.steps.`when`.`When I send a DELETE request` -import integration.steps.`when`.`When I send a GET request` -import integration.steps.`when`.`When I send a POST request` -import integration.steps.`when`.`When I send a PUT request` -import integration.steps.`when`.`with body` import integration.steps.given.`Given I have citizen` import integration.steps.given.`Given I have workgroup` import integration.steps.given.`With members` @@ -15,11 +8,18 @@ import integration.steps.given.`authenticated as` import integration.steps.given.`with no content` import integration.steps.then.`And have property` import integration.steps.then.`And the response should be null` -import integration.steps.then.`And the response should contain list` import integration.steps.then.`And the response should contain` +import integration.steps.then.`And the response should contain list` import integration.steps.then.`And the response should not be null` import integration.steps.then.`Then the response should be` import integration.steps.then.and +import integration.steps.`when`.Validate.REQUEST_BODY +import integration.steps.`when`.Validate.REQUEST_PARAM +import integration.steps.`when`.`When I send a DELETE request` +import integration.steps.`when`.`When I send a GET request` +import integration.steps.`when`.`When I send a POST request` +import integration.steps.`when`.`When I send a PUT request` +import integration.steps.`when`.`with body` import io.ktor.http.HttpStatusCode.Companion.BadRequest import io.ktor.http.HttpStatusCode.Companion.Created import io.ktor.http.HttpStatusCode.Companion.NoContent diff --git a/src/test/kotlin/integration/steps/then/request.kt b/src/test/kotlin/integration/steps/then/request.kt index cdea9e5..57dc5a3 100644 --- a/src/test/kotlin/integration/steps/then/request.kt +++ b/src/test/kotlin/integration/steps/then/request.kt @@ -7,9 +7,9 @@ import io.ktor.http.HttpStatusCode import io.ktor.server.testing.TestApplicationCall import io.ktor.server.testing.TestApplicationResponse import net.minidev.json.JSONArray +import org.amshove.kluent.`should be` import org.amshove.kluent.`should be equal to` import org.amshove.kluent.`should be null` -import org.amshove.kluent.`should be` import org.amshove.kluent.`should not be null` import org.amshove.kluent.shouldContain import org.junit.jupiter.api.assertThrows