UnitTestBot / UTBotJava

Automated unit test generation and precise code analysis for Java
Apache License 2.0
132 stars 40 forks source link

Fix creation of variables for class fields #2713

Closed tepa46 closed 9 months ago

tepa46 commented 9 months ago

Description

Fixes #2638

Different models from different executions may have the same id. Therefore, when creating a variable for a new class field and using existing currentTestSetId and currentExecutionId, field's model.wrap() may match one of the values in annotatedModels. To avoid false matches when creating a variable for a new class field, withTestSetIdScope(-1) and withExecutionIdScope(-1) are used.

How to test

Manual tests

The fix has been tested on projects:

Self-check list