Fix API break in Fake classes must be named using Fake and the interface it fakes

It seems that the workaround is not necessary anymore.
This commit is contained in:
Benoit Marty
2024-11-26 11:09:38 +01:00
parent 06714dd7f3
commit 6e162f0a44

View File

@@ -91,11 +91,7 @@ class KonsistClassNameTest {
.replace("Fake", "")
val result = (it.name.startsWith("Fake") || it.name.startsWith("FakeRust")) &&
it.parents().any { parent ->
// Workaround to get the parent name. For instance:
// parent.name used to return `UserListPresenter.Factory` but is now returning `Factory`.
// So we need to retrieve the name of the parent class differently.
val packageName = parent.packagee!!.name
val parentName = parent.fullyQualifiedName!!.substringAfter("$packageName.").replace(".", "")
val parentName = parent.name.replace(".", "")
parentName == interfaceName
}
if (!result && it.name in failingCasesList) {