You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+19-4Lines changed: 19 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,35 @@
4
4
5
5
## [Unreleased]
6
6
7
+
## [0.4.0]
8
+
### Added
9
+
-[#4](https://github.com/picimako/mockitools/issues/4): Added an intention action that can convert `Mockito.mock()` calls to `@Mock` annotated fields.
10
+
-[#8](https://github.com/picimako/mockitools/issues/8): Added a new inspection that reports multiple consecutive calls on `*Throw()` stubbing calls.
11
+
They can be merged into a single such call.
12
+
-[#8](https://github.com/picimako/mockitools/issues/8): Merging of consecutive `*Return()` and `*Throw()` stubbing calls can happen separately if
13
+
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.
14
+
-[#12](https://github.com/picimako/mockitools/issues/12): Added a new intention action that can convert arguments of `*Throw()` stubbing methods
15
+
from `Type.class` expressions to `new Type()` expressions and vice versa.
16
+
-[#13](https://github.com/picimako/mockitools/issues/13): Added 4 new intention actions that can convert between the various stubbing approaches.
17
+
-[#15](https://github.com/picimako/mockitools/issues/15): Added 2 new intention actions that can convert between the `Mockito.verify()`
18
+
and `BDDMockito.then()` approaches, and vice versa.
19
+
-[#16](https://github.com/picimako/mockitools/issues/16): Added a new inspection that can enforce `org.mockito.Mockito` or `org.mockito.BDDMockito` based
20
+
stubbing and verification.
21
+
7
22
## [0.3.0]
8
23
-**IntelliJ version support: versions prior to 2021.1 are no longer supported.**
9
24
10
25
### Added
11
26
- Added a new inspection to report checked exceptions in `*Throw()` stubbing calls that are not specified in the stubbed method's `throws` clause.
12
27
See [documentation](/docs/stubbing.md#invalid-checked-exception-is-passed-into-throw-methods).
13
-
-[#8](https://github.com/picimako/mockitools/issues/8): Added a new inspection that reports multiple consecutive calls on `*Return()` stubbing calls. These can be merged into a single such call.
14
-
See [documentation](docs/stubbing.md#consecutive-return-calls-can-be-merged).
28
+
-[#8](https://github.com/picimako/mockitools/issues/8): Added a new inspection that reports multiple consecutive calls on `*Return()` stubbing calls.
29
+
These can be merged into a single such call. See [documentation](docs/stubbing.md#consecutive-return-and-throw-calls-can-be-merged).
15
30
16
31
### Changed
17
32
- Updated Gradle IntelliJ plugin to 1.4.0, gradle to 7.4, and qodana-action to 4.2.5.
18
33
- 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*.
19
34
This will allow certain functionality to run in files whose names don't end with *Test*.
20
-
35
+
21
36
## [0.2.0]
22
37
### Added
23
38
-[#2](https://github.com/picimako/mockitools/issues/2): Extended `MockTypeInspection` to validate and report types annotated with `@DoNotMock` annotation.
@@ -27,7 +42,7 @@ See [documentation](docs/stubbing.md#consecutive-return-calls-can-be-merged).
27
42
-[Mockito pull request: Add annotation to mark a type as DoNotMock](https://github.com/mockito/mockito/pull/1833/files)
28
43
- Extended `MockTypeInspection` to validate new expressions (i.e. `new Clazz()`) against non-mockable types.
29
44
-[#4](https://github.com/picimako/mockitools/issues/4): Added intention to convert `Mockito.spy()` calls to `@Spy` annotated fields.
30
-
See [documentation](docs/mock_creation.md#convert-mockitospy-calls-to-spy-fields).
45
+
See [documentation](docs/mock_creation.md#convert-mockitomockspy-calls-to-mockspy-fields).
31
46
-[#4](https://github.com/picimako/mockitools/issues/4): Added intention to convert `@Mock` and `@Spy` annotated fields to `Mockito.mock` and `Mockito.spy()`
32
47
calls, respectively. See [documentation](docs/mock_creation.md#convert-mockspy-fields-to-mockitomockspy-calls).
This is an IntelliJ-based plugin for [Mockito](https://site.mockito.org), one of the (if not the) most popular mocking framework for unit tests in Java.
10
+
Mockitools is a plugin for IntelliJ-based IDEs that provides framework integration for [Mockito](https://site.mockito.org), one of the (if not the) most popular mocking frameworks for unit testing in Java.
9
11
<!-- Plugin description end -->
10
12
11
13
It is available for IntelliJ Community Edition as well as IntelliJ IDEA Ultimate Edition.
@@ -14,32 +16,31 @@ It is available for IntelliJ Community Edition as well as IntelliJ IDEA Ultimate
14
16
15
17
### Mockito 4 migration aids
16
18
17
-
There is a handful of inspections available to help to migrate users from Mockito 2.x/3.x to 4.x.
18
-
19
-
Since Mockito 4 has been released only recently, they are enabled by default. But, if you are already
20
-
using Mockito 4, it is recommended to disable them, so that IntelliJ doesn't execute inspection that don't make sense
21
-
in terms of your project(s). See <kbd>Java</kbd> > <kbd>Mockito</kbd> > <kbd>Migration aids (v4)</kbd> in Inspection settings.
19
+
There is a handful of inspections available to help migrate users from Mockito 2.x/3.x to 4.x.
22
20
23
-
Eventually, when a good amount of time passed and many users potentially moved to v4, these inspections will be disabled by default.
21
+
Since Mockito 4 has been released only recently, they are enabled by default, but if you are already
22
+
using Mockito 4, it is recommended to disable them in <kbd>Java</kbd> > <kbd>Mockito</kbd> > <kbd>Migration aids (v4)</kbd> in Inspection settings,
23
+
so they are not executed for your project. As users move to v4, eventually they will get disabled by default.
24
24
25
-
The list and details of those inspections can be found in [Mockito v4 migration aids](docs/migration_aids_v4.md).
25
+
See the list of those inspections in [Mockito v4 migration aids](docs/migration_aids_v4.md).
26
26
27
27
### SonarLint
28
28
29
-
SonarLint also have a few inspections for Mockito, you can find them under the [Java category](https://rules.sonarsource.com/java?search=mockito).
29
+
SonarLint also has a few inspections for Mockito that you can find under the [Java category](https://rules.sonarsource.com/java?search=mockito) of their rules.
30
30
31
-
If you use SonarLint or any other plugin that has checks for things provided by the Mockitools plugin, it is advised adjusting your settings,
32
-
so that only those versions of the inspections are enabled that you feel comfortable working with.
31
+
If you use SonarLint to validate things that are available in Mockitools too, it is advised to adjust your settings,
32
+
and have only those ones enabled that you feel comfortable working with. Be it in SonarLint or in Mockitools.
33
33
This will help declutter your editor from duplicate highlights for the same problems, and will also improve the analysis performance in the IDE.
34
34
35
-
You can find the list of those inspections in the [Mockitools/SonarLint rules](docs/mockitools_sonarlint_rules.md) document.
35
+
You can find the list of those inspections in the [Mockitools/SonarLint rules](docs/sonarlint_rules.md) document.
36
36
37
37
## Why Mockitools is tasty
38
38
39
39
If [*"Mockito ... tastes really good"* and *"doesn’t give you hangover"*](https://site.mockito.org/#why), this IDE plugin will only make it better. You can find out why, in the dedicated documentation below.
Copy file name to clipboardExpand all lines: docs/migration_aids_v4.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,14 @@ some inspections to help migrate from one version to another; in the context of
5
5
6
6
Check out the [Mockito 4.0.0 release notes](https://github.com/mockito/mockito/releases/tag/v4.0.0) for details.
7
7
8
-
### Argument matchers are called via org.mockito.Matchers instead of org.mockito.ArgumentMatchers
8
+
-[Argument matchers are called via org.mockito.Matchers instead of org.mockito.ArgumentMatchers](#argument-matchers-are-called-via-orgmockitomatchers-instead-of-orgmockitoargumentmatchers)
9
+
-[Usage of deprecated anyX() matchers](#usage-of-deprecated-anyx-matchers)
10
+
-[Usage of parameterized variants of isNull(), isNotNull() and notNull()](#usage-of-parameterized-variants-of-isnull-isnotnull-and-notnull)
11
+
-[Usage of deprecated verify methods](#usage-of-deprecated-verify-methods)
12
+
-[Usage of deprecated plugins classes](#usage-of-deprecated-plugins-classes)
13
+
-[Usage of deprecated JUnit runners](#usage-of-deprecated-junit-runners)
14
+
15
+
### Argument matchers are called via org.mockito.Matchers instead of org.mockito.ArgumentMatchers
If a matcher is not used with static import and referenced via `org.mockito.Matchers`, it is also replaced
68
-
with the `org.mockito.ArgumentMatchers` qualifier. See the corresponding logic in [ReplaceMatchersWithArgumentMatchersQuickFix](../src/main/java/com/picimako/mockitools/inspection/migrationaids/v4/UseArgumentMatchersInsteadOfMatchersInspection.java).
75
+
with the `org.mockito.ArgumentMatchers` qualifier. See the corresponding logic in [ReplaceAnyXOfWithAnyXQuickFix](../src/main/java/com/picimako/mockitools/inspection/migrationaids/v4/UsageOfAnyMatchersInspection.java).
69
76
70
77
### Usage of parameterized variants of isNull(), isNotNull() and notNull()
0 commit comments