Releases: picimako/mockitools
Releases · picimako/mockitools
v1.5.0
v1.4.1
v1.4.0
v1.3.1
v1.3.0
Added
- The inspection reporting spy creation on a mock object now also recognizes passed in mock objects when they are created either with
Mockito.mock()
orMockito.spy()
. - 66: Added an inspection that can report the stubbing of private and native methods, as well as
equals()
andhashCode()
. - 63: Added an inspection to report
ArgumentCaptor.captor()
calls when they are passed in at least one argument. This method is not designed to accept any argument. - 55: Added an inspection to report explicit initialization of
@Mock
and@InjectMocks
annotated fields. - Added support for generic inferred
Mockito.mock()
andMockito.spy()
calls when converting from those calls to@Mock
and@Spy
fields, respectively.
Changed
- Applied a couple of code simplifications for easier maintenance.
- Improved the documentation, in many cases by replacing textual code examples with screenshots and gifs.
Fixed
- Fixed the title of the list popup when selecting the target stubbing during conversion.
- Fixed a threading related exception that occurred during converting
@Mock
or@Spy
fields to their corresponding method call versions. - Fixed some potential
ArrayIndexOutOfBoundsException
s.
v1.2.0
v1.1.0
v1.0.0
Changed
- New support range of IDEs: 2022.3-2023.3
- Various code optimizations based on new IntelliJ Platform inspections.
v0.12.0
Added
- #52: Added code completion for parameters of methods in the
Mockito
class that need mock objects to be passed in (e.g.reset()
orverifyNoMoreInteractions()
).
The list only shows@Mock
,@Spy
and@InjectMocks
annotated fields, as well as local variables created withMockito.mock()
orMockito.spy()
.
Fixed
- Fixed an issue that stubbed checked exceptions were marked mistakenly as having no matching checked exception in the stubbed method's
throws
clause,
even if the throws clause containedException
orThrowable
. - Fixed an issue that when analyzing mixed matcher/non-matcher arguments of stubbed methods, type cast constructs like
(SomeObject) any()
were not considered matchers by the plugin,
and marked falsely.
v0.11.0
Added
- #53: Added an inspection to report when the mocked type and the type of the spied instance don't match in a
mock(Type.class, withSettings().spiedInstance(...));
-type mock creation. - #56: Added an inspection to report spying on mock objects, i.e.
Mockito.spy(Mockito.mock(...))
andMockito.spy(<object annotated with @Mock>)
. - #57: Added an inspection to report arguments passed into
Mockito.mock()
andMockito.spy()
which are designed to determine the mock type based on the variable's type they are assigned to, and not by the type passed into them. See Mocking/spying without specifying class. - #58: Added an inspection to report
MockSettings
-based mock creations that have convenience methods or simpler variants to create the mock. - #59: Added an intention action to expand simple mock and spy creation calls to use specific
MockSettings
, for exampleMockito.mock(<type>, <answer>)
is converted toMockito.mock(<type>, Mockito.withSettings().defaultAnswer(<answer>))
.
Changed
- Plugin configuration updates, and code improvements specific to migrating from Java 11 to 17.