Skip to content

Commit 079230d

Browse files
committed
Collect required util methods regardless of util method provider
1 parent 30adfe0 commit 079230d

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/TestFrameworkManager.kt

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package org.utbot.framework.codegen.model.constructor.tree
33
import org.utbot.framework.codegen.Junit4
44
import org.utbot.framework.codegen.Junit5
55
import org.utbot.framework.codegen.TestNg
6-
import org.utbot.framework.codegen.model.constructor.builtin.TestClassUtilMethodProvider
76
import org.utbot.framework.codegen.model.constructor.builtin.forName
87
import org.utbot.framework.codegen.model.constructor.context.CgContext
98
import org.utbot.framework.codegen.model.constructor.context.CgContextOwner
@@ -95,19 +94,14 @@ internal abstract class TestFrameworkManager(val context: CgContext)
9594
}
9695

9796
open fun getDeepEqualsAssertion(expected: CgExpression, actual: CgExpression): CgMethodCall {
98-
// If an util method provider is not TestClassUtilMethodProvider, then we are using util methods from library.
99-
// In this case we don't need to add required util methods to the test class,
100-
// because they are all already in a library.
101-
if (utilMethodProvider is TestClassUtilMethodProvider) {
102-
requiredUtilMethods += setOf(
103-
utilMethodProvider.deepEqualsMethodId,
104-
utilMethodProvider.arraysDeepEqualsMethodId,
105-
utilMethodProvider.iterablesDeepEqualsMethodId,
106-
utilMethodProvider.streamsDeepEqualsMethodId,
107-
utilMethodProvider.mapsDeepEqualsMethodId,
108-
utilMethodProvider.hasCustomEqualsMethodId
109-
)
110-
}
97+
requiredUtilMethods += setOf(
98+
utilMethodProvider.deepEqualsMethodId,
99+
utilMethodProvider.arraysDeepEqualsMethodId,
100+
utilMethodProvider.iterablesDeepEqualsMethodId,
101+
utilMethodProvider.streamsDeepEqualsMethodId,
102+
utilMethodProvider.mapsDeepEqualsMethodId,
103+
utilMethodProvider.hasCustomEqualsMethodId
104+
)
111105
// TODO we cannot use common assertEquals because of using custom deepEquals
112106
// For this reason we have to use assertTrue here
113107
// Unfortunately, if test with assertTrue fails, it gives non informative message false != true

0 commit comments

Comments
 (0)