Skip to content

Releases: picimako/mockitools

v1.4.0

20 Sep 13:13
bf04c47
Compare
Choose a tag to compare

Changed

  • New supported IDE version range: 2024.2 - 2024.3.*.
  • Updated the project to use the IntelliJ Platform Gradle Plugin 2.0.
  • Updated the project to use JDK 21.

Fixed

  • Fixed some links in the documentation.

v1.3.1

13 Sep 06:05
a4c266f
Compare
Choose a tag to compare

Changed

  • 69: Temporarily remove the inspection introduced in 55 to further investigate its viability.

v1.3.0

10 Sep 15:38
f7d8e7a
Compare
Choose a tag to compare

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() or Mockito.spy().
  • 66: Added an inspection that can report the stubbing of private and native methods, as well as equals() and hashCode().
  • 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() and Mockito.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 ArrayIndexOutOfBoundsExceptions.

v1.2.0

05 Jun 07:24
7ff45de
Compare
Choose a tag to compare

Changed

  • New support range of IDEs: 2023.3-2024.2-EAP.
  • Dependency updates.

Fixed

  • Fixed an exception that occurred during previewing the quick fix result for simplifying mock creations.

v1.1.0

01 Feb 06:26
542c866
Compare
Choose a tag to compare

Changed

  • New support range of IDEs: 2023.1.5-2024.1-EAP.
  • Dependency updates.

v1.0.0

15 Oct 08:31
d1e2cf8
Compare
Choose a tag to compare

Changed

  • New support range of IDEs: 2022.3-2023.3
  • Various code optimizations based on new IntelliJ Platform inspections.

v0.12.0

20 Sep 07:41
3fbee49
Compare
Choose a tag to compare

Added

  • #52: Added code completion for parameters of methods in the Mockito class that need mock objects to be passed in (e.g. reset() or verifyNoMoreInteractions()).
    The list only shows @Mock, @Spy and @InjectMocks annotated fields, as well as local variables created with Mockito.mock() or Mockito.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 contained Exception or Throwable.
  • 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

15 Jul 08:18
Compare
Choose a tag to compare

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(...)) and Mockito.spy(<object annotated with @Mock>).
  • #57: Added an inspection to report arguments passed into Mockito.mock() and Mockito.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 example Mockito.mock(<type>, <answer>) is converted to Mockito.mock(<type>, Mockito.withSettings().defaultAnswer(<answer>)).

Changed

  • Plugin configuration updates, and code improvements specific to migrating from Java 11 to 17.

v0.10.0

19 Jun 09:00
4bd75ad
Compare
Choose a tag to compare
  • 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 withoutAnnotations attribute of the @Mock annotation.
  • 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

05 Mar 11:36
fee53a8
Compare
Choose a tag to compare

Changed

  • Dropped support for IJ-2021.3.
  • Added support for IJ-2023.1.
  • Minor simplifications under the hood.