-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
comp-codegenIssue is related to code generatorIssue is related to code generatorctg-bugIssue is a bugIssue is a bug
Description
Description
There are redundant brackets added around mock definitions.
There are redundant brackets around class cast.
To Reproduce
- Install UnitTestBot plugin built from main in IntelliJ IDEA
- Open
spring-petclinic
- Generate tests for
OwnerController
class - Check all
ownerRepositoryMock
usages
Expected behavior
The whole expression should not be rounded with brackets.
Class cast should have only required brackets, like following:
when(ownerRepositoryMock.findById(any())).thenReturn((Owner) null);
Actual behavior
There are redundant brackets added around expressions in mock definitions.
There are redundant brackets when class cast is used.
Screenshots, logs
(when(ownerRepositoryMock.findById(any()))).thenReturn(((Owner) null));
Environment
IntelliJ IDEA version - CU/IU 2023.1
Project - Maven
JDK - 1.8 / 17
Additional context
Actual for other projects
Metadata
Metadata
Assignees
Labels
comp-codegenIssue is related to code generatorIssue is related to code generatorctg-bugIssue is a bugIssue is a bug
Type
Projects
Status
Todo