File tree Expand file tree Collapse file tree
main/resources/META-INF/rewrite
test/java/org/openrewrite/java/testing/mockito Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ recipeList:
2828 - org.openrewrite.java.testing.mockito.ReplacePowerMockDependencies
2929 - org.openrewrite.java.RemoveAnnotation :
3030 annotationPattern : " @org.powermock.core.classloader.annotations.PowerMockIgnore"
31+ - org.openrewrite.java.RemoveAnnotation :
32+ annotationPattern : " @org.powermock.core.classloader.annotations.SuppressStaticInitializationFor"
3133 - org.openrewrite.java.ChangeMethodTargetToStatic :
3234 methodPattern : org.powermock.api.mockito.PowerMockito mockStatic(..)
3335 fullyQualifiedTargetTypeName : org.mockito.Mockito
Original file line number Diff line number Diff line change @@ -1826,4 +1826,35 @@ void removesManagedPowerMockDependencies() {
18261826 )
18271827 );
18281828 }
1829+
1830+ @ Test
1831+ void thatSuppressStaticInitializationForIsRemoved () {
1832+ //language=java
1833+ rewriteRun (
1834+ java (
1835+ """
1836+ import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
1837+ import org.testng.annotations.Test;
1838+
1839+ @SuppressStaticInitializationFor("com.example.MyClass")
1840+ class StaticInitTest {
1841+
1842+ @Test
1843+ void testSomething() {
1844+ }
1845+ }
1846+ """ ,
1847+ """
1848+ import org.testng.annotations.Test;
1849+
1850+ class StaticInitTest {
1851+
1852+ @Test
1853+ void testSomething() {
1854+ }
1855+ }
1856+ """
1857+ )
1858+ );
1859+ }
18291860}
You can’t perform that action at this time.
0 commit comments