Fix cucumber tests
This commit is contained in:
@@ -60,7 +60,7 @@ class OpinionSteps : En, KoinTest {
|
|||||||
createdBy = get<CitizenRepository>().findByUsername("$firstName-$lastName".toLowerCase().replace(' ', '-'))
|
createdBy = get<CitizenRepository>().findByUsername("$firstName-$lastName".toLowerCase().replace(' ', '-'))
|
||||||
?: error("Citizen not exist")
|
?: error("Citizen not exist")
|
||||||
)
|
)
|
||||||
get<OpinionRepository>().updateOpinions(opinion.choice, opinion.createdBy, opinion.target)
|
get<OpinionRepository>().addOpinion(opinion)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createOpinionOnArticle(extraInfo: DataTable? = null) {
|
private fun createOpinionOnArticle(extraInfo: DataTable? = null) {
|
||||||
|
|||||||
@@ -59,7 +59,11 @@ class WorkgroupSteps : En, KoinTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Then("The workgroup {string} exists") { id: String ->
|
Then("The workgroup {string} exists") { id: String ->
|
||||||
Assert.assertNotNull(get<CitizenRepository>().findById(id.toUUID()))
|
Assert.assertNotNull(get<WorkgroupRepository>().findById(id.toUUID()))
|
||||||
|
}
|
||||||
|
|
||||||
|
Then("The workgroup {string} not exists") { id: String ->
|
||||||
|
Assert.assertNull(get<WorkgroupRepository>().findById(id.toUUID()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,9 @@ Feature: Opinion
|
|||||||
When I send a PUT request to "/articles/9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b/opinions" with body:
|
When I send a PUT request to "/articles/9226c1a3-8091-c3fa-7d0d-c2e98c9bee7b/opinions" with body:
|
||||||
"""
|
"""
|
||||||
{
|
{
|
||||||
"opinion_choice": "0f4f1721-3136-44f1-9f31-1459f3317b15"
|
"ids": [
|
||||||
|
"0f4f1721-3136-44f1-9f31-1459f3317b15"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
Then the response status code should be 201
|
Then the response status code should be 201
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ Feature: Workgroup
|
|||||||
| id | ab469134-bf14-4856-b093-ae1aa990f977 |
|
| id | ab469134-bf14-4856-b093-ae1aa990f977 |
|
||||||
When I send a DELETE request to "/workgroups/ab469134-bf14-4856-b093-ae1aa990f977"
|
When I send a DELETE request to "/workgroups/ab469134-bf14-4856-b093-ae1aa990f977"
|
||||||
Then the response status code should be 204
|
Then the response status code should be 204
|
||||||
And The workgroup "ab469134-bf14-4856-b093-ae1aa990f977" exists
|
And The workgroup "ab469134-bf14-4856-b093-ae1aa990f977" not exists
|
||||||
|
|
||||||
Scenario: Can get workgroups list
|
Scenario: Can get workgroups list
|
||||||
Given I have citizen Max Planck
|
Given I have citizen Max Planck
|
||||||
@@ -68,7 +68,7 @@ Feature: Workgroup
|
|||||||
{"id":"b5bac515-45d4-4aeb-9b6d-2627a0bbc419"}
|
{"id":"b5bac515-45d4-4aeb-9b6d-2627a0bbc419"}
|
||||||
]
|
]
|
||||||
"""
|
"""
|
||||||
Then the response status code should be 200
|
Then the response status code should be 201
|
||||||
|
|
||||||
Scenario: Can remove member to workgroup
|
Scenario: Can remove member to workgroup
|
||||||
Given I have citizen Heinrich Hertz
|
Given I have citizen Heinrich Hertz
|
||||||
|
|||||||
Reference in New Issue
Block a user