Lint
This commit is contained in:
@@ -76,12 +76,20 @@ class ConstitutionSteps : En, KoinTest {
|
|||||||
get<ConstitutionRepository>().upsert(constitution)
|
get<ConstitutionRepository>().upsert(constitution)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun commentConstitution(constitutionId: String, firstName: String, lastName: String, extraData: DataTable? = null) {
|
private fun commentConstitution(
|
||||||
|
constitutionId: String,
|
||||||
|
firstName: String,
|
||||||
|
lastName: String,
|
||||||
|
extraData: DataTable? = null
|
||||||
|
) {
|
||||||
val params = extraData?.asMap<String, String>(String::class.java, String::class.java)
|
val params = extraData?.asMap<String, String>(String::class.java, String::class.java)
|
||||||
|
|
||||||
val constitution = get<ConstitutionRepository>().findById(UUID.fromString(constitutionId)) ?: error("Constitution not exist")
|
val constitution =
|
||||||
|
get<ConstitutionRepository>().findById(UUID.fromString(constitutionId)) ?: error("Constitution not exist")
|
||||||
|
|
||||||
val citizen = get<CitizenRepository>().findByUsername(("$firstName-$lastName".toLowerCase()).toLowerCase().replace(' ', '-')) ?: error("Citizen not exist")
|
val citizen = get<CitizenRepository>().findByUsername(
|
||||||
|
("$firstName-$lastName".toLowerCase()).toLowerCase().replace(' ', '-')
|
||||||
|
) ?: error("Citizen not exist")
|
||||||
|
|
||||||
val comment: CommentEntity<ConstitutionRef> = CommentEntity(
|
val comment: CommentEntity<ConstitutionRef> = CommentEntity(
|
||||||
id = params?.get("id")?.let { UUID.fromString(it) } ?: UUID.randomUUID(),
|
id = params?.get("id")?.let { UUID.fromString(it) } ?: UUID.randomUUID(),
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ internal class ArticleVoterTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `other user can be view the article`() = ArticleVoter().run {
|
fun `other user can be view the article`() = ArticleVoter().run {
|
||||||
val article = getArticle(tesla)
|
val article = getArticle(tesla)
|
||||||
val article2 = getArticle(tesla)
|
|
||||||
|
|
||||||
mockk<ApplicationCall> {
|
mockk<ApplicationCall> {
|
||||||
every { user } returns einstein.user
|
every { user } returns einstein.user
|
||||||
|
|||||||
Reference in New Issue
Block a user