buszi0809
12/23/2024, 8:44 AM0.15.1
to 0.17.3
and wanted to confirm it is not an issue on my side
I have a test case where I verify that classes that have UseCase as parent interface reside in .impl
package of this parent interface, basically verifying that use case implementations are placed in correct package in relation to the interface definition
before migration it looked like this:
Konsist.scopeFromProject()
.classes()
.withParent { it.hasNameEndingWith("UseCase") }
.assertTrue { impl ->
val parent = impl.parents().first { it.hasNameEndingWith("UseCase") }
impl.resideInPackage(parent.packagee?.fullyQualifiedName + ".impl")
}
now from what I've understood it should look like this:
Konsist.scopeFromProject()
.classes()
.withParentInterface { it.hasNameEndingWith("UseCase") }
.assertTrue { impl ->
val parent = impl.parentInterfaces().first { it.hasNameEndingWith("UseCase") }
impl.resideInPackage(parent.packagee?.name + ".impl")
}
but those tests are failing now, I've printed some values and it seems that the issue is that the parent's package has wrong value that is inherited from the implementation class
so basically let's say that we have ExampleUseCaseImpl
in com.example.impl
, and the parent interface is named ExampleUseCase
in com.example
, it seems that the parent found with val parent = impl.parentInterfaces().first { it.hasNameEndingWith("UseCase") }
has package name value com.example.impl
instead of com.example