Closed as not planned
Description
Description
UtUtils.deepEquals is used in generated CommonMocksExampleTest but not created.
Second UTBot execution generated UtUtils class.
To Reproduce
Steps to reproduce the behavior:
- Open the utbot-sample/src/main/java/org/utbot/examples/mock/CommonMocksExample.java file
- Generate tests in utbot-sample test source root
with "Other packages: Mockito" and "Mockito static mocking" options - Open the generated test
Expected behavior
UtUtils class is supposed to be generated when used.
Actual behavior
UtUtils class is missed.
Import UtUtils.deepEquals is not found.
Tests are not compiling.
Second test generation for the same class creates UtUtils class.
Visual proofs (screenshots, logs, images)
There is the following strings in the generated test class:
import static org.utbot.runtime.utils.UtUtils.deepEquals;
@Test
@DisplayName("nextValue: node.next == node : True -> return node")
public void testNextValue_NodeNextEqualsNode() {
CommonMocksExample commonMocksExample = new CommonMocksExample();
RecursiveTypeClass nodeMock = mock(RecursiveTypeClass.class);
nodeMock.next = nodeMock;
RecursiveTypeClass actual = commonMocksExample.nextValue(nodeMock);
assertTrue(deepEquals(nodeMock, actual));
int nodeMockValue = nodeMock.value;
int actualValue = actual.value;
assertEquals(nodeMockValue, actualValue);
}
Environment
Windows 10 Pro
UTBotJava project
JDK 11 is used
Additional context
Same for code when UtUtils.createInstance is used in the generated test.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done