Skip to content

Commit

Permalink
Prevent StringIndexOutOfBoundsException in ReplacePowerMockitoIntegra…
Browse files Browse the repository at this point in the history
…tionTest
  • Loading branch information
timtebeek committed Oct 27, 2023
1 parent 22dfa7e commit f65e9cc
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ void staticMethodReturningArrayShallNotThrowAnIllegalArgumentException() {
rewriteRun(
java(
"""
package foo;
public class StringFilter {
public static String[] splitFilterStringValues(String filterValue) {
if (filterValue.equals("")) {
Expand All @@ -473,6 +474,7 @@ public static String[] splitFilterStringValues(String filterValue) {
"""
import static org.mockito.Mockito.*;
import foo.StringFilter;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.testng.annotations.Test;
Expand All @@ -487,7 +489,8 @@ public void testStaticMock() {
""",
"""
import static org.mockito.Mockito.*;
import foo.StringFilter;
import org.mockito.MockedStatic;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
Expand Down

0 comments on commit f65e9cc

Please sign in to comment.