Releases: picimako/mockitools
Releases · picimako/mockitools
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.
v0.10.0
- New support range of IDEs: 2022.2-2023.2
- Disabled the v3 to v4 migration aids inspections since Mockito 4.x has already been released for 1.5 years.
- #49: Added support for the
withoutAnnotationsattribute of the@Mockannotation. - Underlying plugin configuration updates, and test optimizations.
- Update inspection description documents to enable code snippet syntax highlighting in them starting from IJ 2023.2.
v0.9.0
Changed
- Dropped support for IJ-2021.3.
- Added support for IJ-2023.1.
- Minor simplifications under the hood.
v0.8.0
Added
- #37: Added inspection to report stub-only mocks when they are used verifications.
- #43: Added support for converting the
mockMakermock setting between the@Mockannotation andMockSettings. - Added missing support for the conversion of the
strictnessmock setting from@MocktoMockSettings.
Changed
- Dropped support for IJ-2021.2.
- Added support for IJ-2022.3 EAPs.
v0.7.0
Added
- #36: Added inspection to report
toString()calls in verifications, since Mockito cannot verifytoString(). - #39: Added inspection to report
*Return()stubbing calls, if the stubbed method's return type is void. - #40: Added inspection to report
doNothing()andwillDoNothing()stubbing calls,
if the stubbed method's return type is not void.
Changed
- #41: Cleaned up the class and package name, and modified the icons in the target method selection
popup during mock field conversion. The new icons can help distinguish between before hooks, test methods, and the rest of the methods. - Refactorings and housekeeping in the mock stubbing and verification areas.
v0.6.0
Added
- #29: Added intentions to convert verifications between
InOrder.verify()andMockedStatic.verify(). - #30: Added inspection reporting for usages of
MockedStatic.reset(). - #32: Added support for
MockedStaticstubbing to report mergeable*Return()and*Throw()method calls. - #33: Added bulk conversion for stubbing call chains. It works the same way as bulk conversion works for verifications.
Changed
- #31: Modified the analysis process of
times(1)calls to specifically check for the verification methods they are used at.
Also optimized the wholetimes(X)analysis. - #33: Reorganized the stubbing conversion intention actions.
Now, only the Convert stubbing(s) to... intention is displayed, and after selecting it, the actual target options become visible.
Fixed
- Fixed an issue when the editor selection was suitable enough, but it didn't actually contain a statement, the stubbing and verification
intentions were still available.
v0.5.0
Added
- #19: Added bulk options to convert verifications from
BDDMockito.then()andMockito.verify()by selecting one or more
verifications in the editor. - #20: Extended the conversion of
InOrder.verify()call chains with a bulk mode,
so that if multiple (or just a single) such call chain is selected/highlighted in the editor, they all can be converted to the same approach at once. - #21: Added an inspection to report InOrder local variables that are used in only one verification call.
BesidesMockedStatic, it can report for bothInOrder.verify()andBDDMockito.then().should(InOrder)verifications. - #22: Added a new action to convert from and to
InOrder.verify()based verification.
Along with it, extended the possible conversion options from and toMockito.verify()andBDDMockito.then()as well.
Details are available in the Verifications document. - #23: Added a quick fix, so that checked exceptions can be added to the stubbed method's
throwsclause
when they are specified in the stubbing, but not in the mentionedthrowsclause. - #24: Strictness configuration is now supported by the conversion between
@MockandMockito.mock(Class, MockSettings)in both directions. EnforceConventionInspectioncan now reportInOrder.verify()calls too, as part of enforcingBDDMockito.then()verification.- #27: Added an inspection that can report mock objects used in misconfigured
InOrderverifications.
Changed
- Removed support for IJ2021.1. From now on 2021.2 is the earliest version supported.
Fixed
- Fixed an issue that when converting from
BDDMockito.then().should(InOrder)toMockito.verify()the InOrder variable remained.
v0.4.1
Changed
- Added support for IJ2022.2.
- Removed Mockitools: prefix from inspection messages. This might help make them more comprehensible, and it removes
the clutter when they are displayed in the code analysis results tool window. - Refactored some intention classes to prevent EDT slow operations errors, and other housekeeping.
v0.4.0
Added
- #4: Added an intention action that can convert
Mockito.mock()calls to@Mockannotated fields. - #8: Added a new inspection that reports multiple consecutive calls on
*Throw()stubbing calls.
They can be merged into a single such call. - #8: Merging of consecutive
*Return()and*Throw()stubbing calls can happen separately if
there are multiple such sections within a stubbing call chain. They, from now on, also keep line wrapping and indentation after applying the quick fix. - #12: Added a new intention action that can convert arguments of
*Throw()stubbing methods
fromType.classexpressions tonew Type()expressions and vice versa. - #13: Added 4 new intention actions that can convert between the various stubbing approaches.
- #15: Added 2 new intention actions that can convert between the
Mockito.verify()
andBDDMockito.then()approaches, and vice versa. - #16: Added a new inspection that can enforce
org.mockito.Mockitoororg.mockito.BDDMockitobased
stubbing and verification.
v0.3.0
- IntelliJ version support: versions prior to 2021.1 are no longer supported.
Added
- Added a new inspection to report checked exceptions in
*Throw()stubbing calls that are not specified in the stubbed method'sthrowsclause.
See documentation. - #8: Added a new inspection that reports multiple consecutive calls on
*Return()stubbing calls. These can be merged into a single such call.
See documentation.
Changed
- Updated Gradle IntelliJ plugin to 1.4.0, gradle to 7.4, and qodana-action to 4.2.5.
- Replaced unit test file checks with a less restrictive, test source root content check, because unit test file names don't necessarily end with the word Test.
This will allow certain functionality to run in files whose names don't end with Test.