Skip to content

Commit 216983b

Browse files
committed
Move mockito-all to mockito-core; Split off powermockito.yml
Fixes #457
1 parent e9f108c commit 216983b

File tree

2 files changed

+61
-41
lines changed

2 files changed

+61
-41
lines changed

src/main/resources/META-INF/rewrite/mockito.yml

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -143,44 +143,7 @@ recipeList:
143143
groupId: org.mockito
144144
artifactId: "*"
145145
newVersion: 3.x
146-
---
147-
type: specs.openrewrite.org/v1beta/recipe
148-
name: org.openrewrite.java.testing.mockito.ReplacePowerMockito
149-
displayName: Replace PowerMock with raw Mockito
150-
description: Replace PowerMock with raw Mockito.
151-
tags:
152-
- testing
153-
- mockito
154-
recipeList:
155-
- org.openrewrite.java.RemoveAnnotation:
156-
annotationPattern: "@org.powermock.core.classloader.annotations.PowerMockIgnore"
157-
- org.openrewrite.java.ChangeMethodTargetToStatic:
158-
methodPattern: org.powermock.api.mockito.PowerMockito mockStatic(..)
159-
fullyQualifiedTargetTypeName: org.mockito.Mockito
160-
returnType: org.mockito.MockedStatic
161-
matchOverrides: null
162-
matchUnknownTypes:
163-
- org.openrewrite.java.ChangeMethodTargetToStatic:
164-
methodPattern: org.powermock.api.mockito.PowerMockito do*(..)
165-
fullyQualifiedTargetTypeName: org.mockito.Mockito
166-
matchOverrides: null
167-
matchUnknownTypes: null
168-
- org.openrewrite.java.ChangeMethodTargetToStatic:
169-
methodPattern: org.powermock.api.mockito.PowerMockito mock(..)
170-
fullyQualifiedTargetTypeName: org.mockito.Mockito
171-
matchOverrides: null
172-
matchUnknownTypes: null
173-
- org.openrewrite.java.ChangeMethodTargetToStatic:
174-
methodPattern: org.powermock.api.mockito.PowerMockito spy(..)
175-
fullyQualifiedTargetTypeName: org.mockito.Mockito
176-
matchOverrides: null
177-
matchUnknownTypes: null
178-
- org.openrewrite.java.ChangeMethodTargetToStatic:
179-
methodPattern: org.powermock.api.mockito.PowerMockito when(..)
180-
fullyQualifiedTargetTypeName: org.mockito.Mockito
181-
matchOverrides: null
182-
matchUnknownTypes: null
183-
- org.openrewrite.java.testing.mockito.PowerMockitoMockStaticToMockito
184-
- org.openrewrite.java.dependencies.RemoveDependency:
185-
groupId: org.powermock
186-
artifactId: powermock-api-mockito*
146+
- org.openrewrite.java.dependencies.ChangeDependency:
147+
oldGroupId: org.mockito
148+
oldArtifactId: mockito-all
149+
newArtifactId: mockito-core
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#
2+
# Copyright 2024 the original author or authors.
3+
# <p>
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# <p>
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
# <p>
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
---
18+
type: specs.openrewrite.org/v1beta/recipe
19+
name: org.openrewrite.java.testing.mockito.ReplacePowerMockito
20+
displayName: Replace PowerMock with raw Mockito
21+
description: Replace PowerMock with raw Mockito.
22+
tags:
23+
- testing
24+
- mockito
25+
recipeList:
26+
- org.openrewrite.java.RemoveAnnotation:
27+
annotationPattern: "@org.powermock.core.classloader.annotations.PowerMockIgnore"
28+
- org.openrewrite.java.ChangeMethodTargetToStatic:
29+
methodPattern: org.powermock.api.mockito.PowerMockito mockStatic(..)
30+
fullyQualifiedTargetTypeName: org.mockito.Mockito
31+
returnType: org.mockito.MockedStatic
32+
matchOverrides: null
33+
matchUnknownTypes:
34+
- org.openrewrite.java.ChangeMethodTargetToStatic:
35+
methodPattern: org.powermock.api.mockito.PowerMockito do*(..)
36+
fullyQualifiedTargetTypeName: org.mockito.Mockito
37+
matchOverrides: null
38+
matchUnknownTypes: null
39+
- org.openrewrite.java.ChangeMethodTargetToStatic:
40+
methodPattern: org.powermock.api.mockito.PowerMockito mock(..)
41+
fullyQualifiedTargetTypeName: org.mockito.Mockito
42+
matchOverrides: null
43+
matchUnknownTypes: null
44+
- org.openrewrite.java.ChangeMethodTargetToStatic:
45+
methodPattern: org.powermock.api.mockito.PowerMockito spy(..)
46+
fullyQualifiedTargetTypeName: org.mockito.Mockito
47+
matchOverrides: null
48+
matchUnknownTypes: null
49+
- org.openrewrite.java.ChangeMethodTargetToStatic:
50+
methodPattern: org.powermock.api.mockito.PowerMockito when(..)
51+
fullyQualifiedTargetTypeName: org.mockito.Mockito
52+
matchOverrides: null
53+
matchUnknownTypes: null
54+
- org.openrewrite.java.testing.mockito.PowerMockitoMockStaticToMockito
55+
- org.openrewrite.java.dependencies.RemoveDependency:
56+
groupId: org.powermock
57+
artifactId: powermock-api-mockito*

0 commit comments

Comments
 (0)