Eric
01/04/2024, 3:51 PM@Test
fun `interfaces extending JpaRepository should have 'Repository' suffix`() {
Konsist
.scopeFromProduction()
.interfaces()
.withInterfaceNamed(JpaRepository::class.jvmName)
.assertTrue { it.hasNameEndingWith("Repository") }
}
If I log the interfaces with .onEach { println("${it.name} ${it.interfaces()}") }
then it shows an empty list for each.Swapnil Musale
01/04/2024, 5:05 PM@Test
`fun `classes extending ViewModel should have 'ViewModel' suffix`() {`
Konsist.scopeFromProduction(moduleName = "app")
.classes()
._withAllParentsOf_(ViewModel::class)
._assertTrue_ *{*
*it*.hasNameEndingWith("ViewModel")
}
}
Eric
01/04/2024, 5:11 PM@Test
fun test() {
Konsist
.scopeFromProduction()
.interfaces()
.withParentOf(JpaRepository::class)
.assertTrue { it.hasNameEndingWith("Repository") }
}
thanks!