Skip to content

Conversation

sofurihafe
Copy link
Member

Description

There were unwanted fields with @mock annotation because we were collecting everything from models, including fields and mocks. But there is no need for collecting mocks, they will be created when necessary.

Fixes #2170

How to test

Automated tests

Manual tests

Reproduced the issue from the issue and on the OwnerController class.

@sofurihafe sofurihafe 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 Apr 24, 2023
Copy link
Member

@Damtev Damtev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, LGTM, but need some comments explicitly in the code

@sofurihafe sofurihafe force-pushed the andrey-t/spring_no_unwanted_mocks branch from 31843c7 to f1deb83 Compare April 25, 2023 17:38
@sofurihafe sofurihafe force-pushed the andrey-t/spring_no_unwanted_mocks branch from f1deb83 to 917ea02 Compare April 25, 2023 17:39
@EgorkaKulikov EgorkaKulikov merged commit 169ad42 into main Apr 25, 2023
@EgorkaKulikov EgorkaKulikov deleted the andrey-t/spring_no_unwanted_mocks branch April 25, 2023 21:28
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.

Unexpected @Mock for Collection in Spring Controller tests
3 participants