-
Notifications
You must be signed in to change notification settings - Fork 53
/
mockito.yml
106 lines (105 loc) · 4.51 KB
/
mockito.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#
# Copyright 2021 the original author or authors.
# <p>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# <p>
# https://www.apache.org/licenses/LICENSE-2.0
# <p>
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.testing.mockito.Mockito1to4Migration
displayName: Mockito 4.x upgrade
description: Upgrade Mockito from 1.x to 4.x.
tags:
- testing
- mockito
recipeList:
- org.openrewrite.java.testing.mockito.Mockito1to3Migration
- org.openrewrite.maven.UpgradeDependency:
groupId: org.mockito
artifactId: mockito-junit-jupiter
version: 4.x
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.testing.mockito.Mockito1to3Migration
displayName: Mockito 3.x migration from 1.x
description: Upgrade Mockito from 1.x to 3.x.
tags:
- testing
- mockito
recipeList:
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.mockito.MockitoAnnotations.Mock
newFullyQualifiedTypeName: org.mockito.Mock
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.mockito.Matchers
newFullyQualifiedTypeName: org.mockito.ArgumentMatchers
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.mockito.ArgumentMatchers anyVararg()
newMethodName: any
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.mockito.ArgumentMatchers anyObject()
newMethodName: any
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.mockito.ArgumentMatchers anyListOf()
newMethodName: anyList
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.mockito.ArgumentMatchers anySetOf()
newMethodName: anySet
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.mockito.ArgumentMatchers anyMapOf()
newMethodName: anyMap
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.mockito.ArgumentMatchers anyCollectionOf()
newMethodName: anyCollection
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.mockito.ArgumentMatchers anyIterableOf()
newMethodName: anyIterable
- org.openrewrite.java.DeleteMethodArgument:
methodPattern: org.mockito.ArgumentMatchers isNull(java.lang.Class)
argumentIndex: 0
- org.openrewrite.java.DeleteMethodArgument:
methodPattern: org.mockito.ArgumentMatchers notNull(java.lang.Class)
argumentIndex: 0
- org.openrewrite.java.ReorderMethodArguments:
methodPattern: org.mockito.MockedStatic verify(org.mockito.verification.VerificationMode, org.mockito.MockedStatic.Verification)
newParameterNames:
- verification
- mode
oldParameterNames:
- mode
- verification
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.mockito.Mockito verifyZeroInteractions(..)
newMethodName: verifyNoInteractions
- org.openrewrite.java.ChangeMethodName:
methodPattern: org.mockito.invocation.InvocationOnMock getArgumentAt(int, java.lang.Class)
newMethodName: getArgument
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.mockito.exceptions.verification.TooLittleActualInvocations
newFullyQualifiedTypeName: org.mockito.exceptions.verification.TooFewActualInvocations
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.mockito.configuration.AnnotationEngine
newFullyQualifiedTypeName: org.mockito.plugins.AnnotationEngine
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.mockito.plugins.InstantiatorProvider
newFullyQualifiedTypeName: org.mockito.plugins.InstantiatorProvider2
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: org.mockito.runners.MockitoJUnitRunner
newFullyQualifiedTypeName: org.mockito.junit.MockitoJUnitRunner
- org.openrewrite.java.testing.mockito.CleanupMockitoImports
- org.openrewrite.java.testing.mockito.MockUtilsToStatic
- org.openrewrite.maven.AddDependency:
groupId: org.mockito
artifactId: mockito-junit-jupiter
version: 3.x
onlyIfUsing: org.mockito.junit.jupiter.MockitoExtension
- org.openrewrite.java.testing.junit5.MockitoJUnitToMockitoExtension