Skip to content

Fix creation of variables for class fields#2713

Merged
EgorkaKulikov merged 1 commit into
mainfrom
kirill/fix-creation-of-class-fields
Dec 11, 2023
Merged

Fix creation of variables for class fields#2713
EgorkaKulikov merged 1 commit into
mainfrom
kirill/fix-creation-of-class-fields

Conversation

@tepa46
Copy link
Copy Markdown
Collaborator

@tepa46 tepa46 commented Dec 11, 2023

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:

  • spring-petclinic
  • spring-boot-testing

Self-check list

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@tepa46 tepa46 added comp-codegen Issue is related to code generator ctg-bug-fix PR is fixing a bug comp-spring Issue is related to Spring projects support labels Dec 11, 2023
@tepa46 tepa46 requested a review from EgorkaKulikov December 11, 2023 12:07
@EgorkaKulikov EgorkaKulikov merged commit 9fd7984 into main Dec 11, 2023
@EgorkaKulikov EgorkaKulikov deleted the kirill/fix-creation-of-class-fields branch December 11, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-codegen Issue is related to code generator comp-spring Issue is related to Spring projects support ctg-bug-fix PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mock for LocalDate is created with same variable name as mock for PetType

2 participants