Open
Description
Description
DoNotMockHashCode is failing on ExampleClass. hashCode of the mocked object is returning.
To Reproduce
Steps to reproduce the behavior:
- Run IntelliJ IDEA
- Open UTBotJava project
- Open the utbot-sample/src/main/java/org/utbot/examples/mock/CommonMocksExample.java file
- Generate tests for
doNotMockHashCode
with "Other packages: Mockito" and "No static mocking" - Run the generated test
Expected behavior
testDoNotMockHashCode_ExampleClassHashCode is passed
Actual behavior
testDoNotMockHashCode_ExampleClassHashCode fails on Assertion
hashcode of the mocked object is returned
Visual proofs (screenshots, logs, images)
hashCode is different in every run. Error message in log is like that:
expected: <1119242936> but was: <227290491>
Expected :1119242936
Actual :227290491
Environment
Java 8
Additional context
Even if we make ExampleClass::hashCode return a constant - there will be a random number in the test:
@Override
public int hashCode() {
return 100 * 31;
}
Metadata
Metadata
Assignees
Type
Projects
Status
Todo