Description
Try to generate unit or integration tests for an arbitrary Spring project.
All class fields, annotated with @InjectMocks, @Mock, @Autowired, or mockitoCloseable field are now public.
Example:

In accordance with Mockito documentation, we should (https://javadoc.io/static/org.mockito/mockito-core/3.5.6/org/mockito/MockitoAnnotations.html)
- Make
@InjectMock, @Mock and @Autowired fields private
- Make
mockitoCloseable variable private
- Still use public for
setUp and tearDown methods.
Also it is better to locate setUp and tearDown under test methods, not above them.
Description
Try to generate unit or integration tests for an arbitrary Spring project.
All class fields, annotated with
@InjectMocks,@Mock,@Autowired, ormockitoCloseablefield are now public.Example:
In accordance with Mockito documentation, we should (https://javadoc.io/static/org.mockito/mockito-core/3.5.6/org/mockito/MockitoAnnotations.html)
@InjectMock,@Mockand@Autowiredfields privatemockitoCloseablevariable privatesetUpandtearDownmethods.Also it is better to locate
setUpandtearDownunder test methods, not above them.