|
| 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