Skip to content

Commit

Permalink
Move mockito-all to mockito-core; Split off powermockito.yml
Browse files Browse the repository at this point in the history
Fixes #457
  • Loading branch information
timtebeek committed Jan 15, 2024
1 parent e9f108c commit 216983b
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 41 deletions.
45 changes: 4 additions & 41 deletions src/main/resources/META-INF/rewrite/mockito.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,44 +143,7 @@ recipeList:
groupId: org.mockito
artifactId: "*"
newVersion: 3.x
---
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.testing.mockito.ReplacePowerMockito
displayName: Replace PowerMock with raw Mockito
description: Replace PowerMock with raw Mockito.
tags:
- testing
- mockito
recipeList:
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: "@org.powermock.core.classloader.annotations.PowerMockIgnore"
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.powermock.api.mockito.PowerMockito mockStatic(..)
fullyQualifiedTargetTypeName: org.mockito.Mockito
returnType: org.mockito.MockedStatic
matchOverrides: null
matchUnknownTypes:
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.powermock.api.mockito.PowerMockito do*(..)
fullyQualifiedTargetTypeName: org.mockito.Mockito
matchOverrides: null
matchUnknownTypes: null
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.powermock.api.mockito.PowerMockito mock(..)
fullyQualifiedTargetTypeName: org.mockito.Mockito
matchOverrides: null
matchUnknownTypes: null
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.powermock.api.mockito.PowerMockito spy(..)
fullyQualifiedTargetTypeName: org.mockito.Mockito
matchOverrides: null
matchUnknownTypes: null
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.powermock.api.mockito.PowerMockito when(..)
fullyQualifiedTargetTypeName: org.mockito.Mockito
matchOverrides: null
matchUnknownTypes: null
- org.openrewrite.java.testing.mockito.PowerMockitoMockStaticToMockito
- org.openrewrite.java.dependencies.RemoveDependency:
groupId: org.powermock
artifactId: powermock-api-mockito*
- org.openrewrite.java.dependencies.ChangeDependency:
oldGroupId: org.mockito
oldArtifactId: mockito-all
newArtifactId: mockito-core
57 changes: 57 additions & 0 deletions src/main/resources/META-INF/rewrite/powermockito.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Copyright 2024 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.ReplacePowerMockito
displayName: Replace PowerMock with raw Mockito
description: Replace PowerMock with raw Mockito.
tags:
- testing
- mockito
recipeList:
- org.openrewrite.java.RemoveAnnotation:
annotationPattern: "@org.powermock.core.classloader.annotations.PowerMockIgnore"
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.powermock.api.mockito.PowerMockito mockStatic(..)
fullyQualifiedTargetTypeName: org.mockito.Mockito
returnType: org.mockito.MockedStatic
matchOverrides: null
matchUnknownTypes:
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.powermock.api.mockito.PowerMockito do*(..)
fullyQualifiedTargetTypeName: org.mockito.Mockito
matchOverrides: null
matchUnknownTypes: null
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.powermock.api.mockito.PowerMockito mock(..)
fullyQualifiedTargetTypeName: org.mockito.Mockito
matchOverrides: null
matchUnknownTypes: null
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.powermock.api.mockito.PowerMockito spy(..)
fullyQualifiedTargetTypeName: org.mockito.Mockito
matchOverrides: null
matchUnknownTypes: null
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.powermock.api.mockito.PowerMockito when(..)
fullyQualifiedTargetTypeName: org.mockito.Mockito
matchOverrides: null
matchUnknownTypes: null
- org.openrewrite.java.testing.mockito.PowerMockitoMockStaticToMockito
- org.openrewrite.java.dependencies.RemoveDependency:
groupId: org.powermock
artifactId: powermock-api-mockito*

0 comments on commit 216983b

Please sign in to comment.