Add/fix tags to integration tests
This commit is contained in:
@@ -20,14 +20,14 @@ import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.TestInstance
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
@Tags(Tag("integration"), Tag("citizen"))
|
||||
@Tags(Tag("integration"), Tag("article"))
|
||||
class `Article routes` : BaseTest() {
|
||||
@Test
|
||||
fun `I can get article list`() {
|
||||
withIntegrationApplication {
|
||||
`Given I have articles`(3)
|
||||
`When I send a GET request`("/articles") `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class `Article routes` : BaseTest() {
|
||||
`Given I have workgroup`(name = "Les papy", id = "2bccd5a7-9082-4b31-88f8-e25d70b22b12")
|
||||
`Given I have article created by workgroup`("2bccd5a7-9082-4b31-88f8-e25d70b22b12")
|
||||
`When I send a GET request`("/articles?workgroup=2bccd5a7-9082-4b31-88f8-e25d70b22b12") `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And have property`("$.total") `whish contains` 1
|
||||
`And have property`("$.result[0]workgroup.name") `whish contains` "Les papy"
|
||||
}
|
||||
@@ -51,7 +51,7 @@ class `Article routes` : BaseTest() {
|
||||
withIntegrationApplication {
|
||||
`Given I have article`(id = "13e6091c-8fed-4600-b079-a97a6b7a9800")
|
||||
`When I send a GET request`("/articles/13e6091c-8fed-4600-b079-a97a6b7a9800/versions") `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And have property`("$.total") `whish contains` 1
|
||||
`And have property`("$.result[0].id") `whish contains` "13e6091c-8fed-4600-b079-a97a6b7a9800"
|
||||
}
|
||||
@@ -63,7 +63,7 @@ class `Article routes` : BaseTest() {
|
||||
withIntegrationApplication {
|
||||
`Given I have article`(id = "65cda9f3-8991-4420-8d41-1da9da72c9bb")
|
||||
`When I send a GET request`("/articles/65cda9f3-8991-4420-8d41-1da9da72c9bb") `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And have property`("$.id") `whish contains` "65cda9f3-8991-4420-8d41-1da9da72c9bb"
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ class `Article routes` : BaseTest() {
|
||||
}
|
||||
"""
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And have property`("$.version_id") `whish contains` "09c418b6-63ba-448b-b38b-502b41cd500e"
|
||||
`And have property`("$.title") `whish contains` "title2"
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class `Citizen routes` : BaseTest() {
|
||||
`When I send a GET request`("/citizens") {
|
||||
`authenticated as`("Jean", "Perrin")
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ class `Citizen routes` : BaseTest() {
|
||||
`When I send a GET request`("/citizens/47a05c0f-7329-46c3-a7d0-325db37e9114") {
|
||||
`authenticated as`("Linus", "Pauling")
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And have property`("$.id") `whish contains` "47a05c0f-7329-46c3-a7d0-325db37e9114"
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ class `Citizen routes` : BaseTest() {
|
||||
`When I send a GET request`("/citizens/current") {
|
||||
`authenticated as`("Henri", "Becquerel")
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And have property`("$.id") `whish contains` "47356809-c8ef-4649-8b99-1c5cb9886d38"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.TestInstance
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
@Tags(Tag("integration"), Tag("citizen"))
|
||||
@Tags(Tag("integration"), Tag("comment"), Tag("article"))
|
||||
class `Comment articles routes` : BaseTest() {
|
||||
@Test
|
||||
fun `I can comment article`() {
|
||||
@@ -34,7 +34,7 @@ class `Comment articles routes` : BaseTest() {
|
||||
}
|
||||
"""
|
||||
} `Then the response should be` Created and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And the response should contain`("$.target.id", "aa16c635-28da-46f0-9a89-934eef88c7ca")
|
||||
`And the response should contain`("$.content", "Hello mister")
|
||||
}
|
||||
@@ -51,7 +51,7 @@ class `Comment articles routes` : BaseTest() {
|
||||
`When I send a GET request`("/articles/6166c078-ca97-4366-b0aa-2a5cd558c78a/comments") {
|
||||
`authenticated as`("Enrico", "Fermi")
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And the response should contain`("$.result[0].target.id", "6166c078-ca97-4366-b0aa-2a5cd558c78a")
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ class `Comment articles routes` : BaseTest() {
|
||||
`When I send a GET request`("/articles/5e209f63-57ce-43ca-922a-273b0d62f567/comments?sort=votes") {
|
||||
`authenticated as`("Pierre", "Curie")
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And the response should contain`("$.result[0].votes.up", 0)
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ class `Comment articles routes` : BaseTest() {
|
||||
`Given I have comment on article`(article = "17df7fb9-b388-4e20-ab19-29c29972da01", createdByUsername = "erwin-schrodinger")
|
||||
`When I send a GET request`("/citizens/292a20cc-4a60-489e-9866-a95d38ffaf47/comments/articles") {
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And the response should contain`("$.current_page", 1)
|
||||
`And the response should contain`("$.limit", 50)
|
||||
`And the response should contain`("$.result[0]created_by.id", "292a20cc-4a60-489e-9866-a95d38ffaf47")
|
||||
@@ -101,7 +101,7 @@ class `Comment articles routes` : BaseTest() {
|
||||
Hello boy
|
||||
"""
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And the response should contain`("$.content", "Hello boy")
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ class `Comment articles routes` : BaseTest() {
|
||||
)
|
||||
`When I send a GET request`("/comments/edd296a8-fc7a-4717-a2bb-9f035ceca3c2") {
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And the response should contain`("$.content", "Hello boy")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.TestInstance
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
@Tags(Tag("integration"), Tag("citizen"))
|
||||
@Tags(Tag("integration"), Tag("constitution"), Tag("comment"))
|
||||
class `Comment constitutions routes` : BaseTest() {
|
||||
@Test
|
||||
fun `I can comment constitution`() {
|
||||
@@ -34,7 +34,7 @@ class `Comment constitutions routes` : BaseTest() {
|
||||
}
|
||||
"""
|
||||
} `Then the response should be` Created and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ class `Comment constitutions routes` : BaseTest() {
|
||||
`Given I have comment on constitution`(constitution = "34ddd50a-da00-4a90-a869-08baa2a121be", createdByUsername = "charles-darwin")
|
||||
`When I send a GET request`("/citizens/46e0bda9-ca6a-4c65-a58b-7e7267a0bbc5/comments/constitutions") {
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
`And the response should contain`("$.current_page", 1)
|
||||
`And the response should contain`("$.limit", 50)
|
||||
`And the response should contain`("$.result[0].created_by.id", "46e0bda9-ca6a-4c65-a58b-7e7267a0bbc5")
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.TestInstance
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
@Tags(Tag("integration"), Tag("citizen"))
|
||||
@Tags(Tag("integration"), Tag("comment"))
|
||||
class `Comment routes` : BaseTest() {
|
||||
@Test
|
||||
fun `I can get comments children`() {
|
||||
@@ -26,7 +26,7 @@ class `Comment routes` : BaseTest() {
|
||||
`When I send a GET request`("/comments/da22fc55-b0fd-42a5-a317-9583b1bb93c5/children") {
|
||||
`authenticated as`("John", "Dalton")
|
||||
} `Then the response should be` OK and {
|
||||
`And the response should not be null`
|
||||
`And the response should not be null`()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.TestInstance
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
@Tags(Tag("integration"), Tag("auth"))
|
||||
@Tags(Tag("integration"), Tag("auth"), Tag("login"))
|
||||
class `Login routes` : BaseTest() {
|
||||
@Test
|
||||
fun `I can login with username and password`() {
|
||||
@@ -28,7 +28,7 @@ class `Login routes` : BaseTest() {
|
||||
}
|
||||
"""
|
||||
}.`Then the response should be`(HttpStatusCode.OK) {
|
||||
`And the response should not be null` `and should contains` "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9."
|
||||
`And the response should not be null`() `and should contains` "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.junit.jupiter.api.Test
|
||||
import org.junit.jupiter.api.TestInstance
|
||||
|
||||
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||
@Tags(Tag("integration"), Tag("auth"))
|
||||
@Tags(Tag("integration"), Tag("auth"), Tag("register"))
|
||||
class `Register routes` : BaseTest() {
|
||||
@Test
|
||||
fun `I can register`() {
|
||||
|
||||
@@ -66,7 +66,7 @@ fun TestApplicationResponse.`And the response should contain list`(path: String,
|
||||
}
|
||||
}
|
||||
|
||||
val TestApplicationResponse.`And the response should not be null` get() = content.`should not be null`()
|
||||
fun TestApplicationResponse.`And the response should not be null`() = content.`should not be null`()
|
||||
fun TestApplicationResponse.`And the response should be null`() = content.`should be null`()
|
||||
infix fun String.`and should contains`(expected: String) = this
|
||||
.`should not be null`()
|
||||
|
||||
Reference in New Issue
Block a user