Skip to content

Commit f65e9cc

Browse files
committed
Prevent StringIndexOutOfBoundsException in ReplacePowerMockitoIntegrationTest
1 parent 22dfa7e commit f65e9cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/test/java/org/openrewrite/java/testing/mockito/ReplacePowerMockitoIntegrationTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ void staticMethodReturningArrayShallNotThrowAnIllegalArgumentException() {
458458
rewriteRun(
459459
java(
460460
"""
461+
package foo;
461462
public class StringFilter {
462463
public static String[] splitFilterStringValues(String filterValue) {
463464
if (filterValue.equals("")) {
@@ -473,6 +474,7 @@ public static String[] splitFilterStringValues(String filterValue) {
473474
"""
474475
import static org.mockito.Mockito.*;
475476
477+
import foo.StringFilter;
476478
import org.powermock.core.classloader.annotations.PrepareForTest;
477479
import org.testng.annotations.Test;
478480
@@ -487,7 +489,8 @@ public void testStaticMock() {
487489
""",
488490
"""
489491
import static org.mockito.Mockito.*;
490-
492+
493+
import foo.StringFilter;
491494
import org.mockito.MockedStatic;
492495
import org.testng.annotations.AfterMethod;
493496
import org.testng.annotations.BeforeMethod;

0 commit comments

Comments
 (0)