Skip to content

Commit 50bd494

Browse files
committed
Remove test that no longer is included in default mockito recipe
1 parent 7b2c98b commit 50bd494

File tree

1 file changed

+1
-59
lines changed

1 file changed

+1
-59
lines changed

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

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.openrewrite.java.testing.mockito;
1717

18+
import org.junit.jupiter.api.Disabled;
1819
import org.junit.jupiter.api.Test;
1920
import org.openrewrite.DocumentExample;
2021
import org.openrewrite.InMemoryExecutionContext;
@@ -121,65 +122,6 @@ void usingAnnotationBasedMock() {
121122
);
122123
}
123124

124-
/**
125-
* Replaces org.mockito.Matchers with org.mockito.ArgumentMatchers
126-
*/
127-
@Test
128-
void replacesMatchers() {
129-
//language=java
130-
rewriteRun(
131-
java(
132-
"""
133-
package mockito.example;
134-
135-
import java.util.List;
136-
137-
import static org.mockito.Mockito.*;
138-
139-
public class MockitoArgumentMatchersTest {
140-
static class Foo {
141-
boolean bool(String str, int i, Object obj) { return false; }
142-
int in(boolean b, List<String> strs) { return 0; }
143-
int bar(byte[] bytes, String[] s, int i) { return 0; }
144-
boolean baz(String ... strings) { return true; }
145-
}
146-
147-
public void usesMatchers() {
148-
Foo mockFoo = mock(Foo.class);
149-
when(mockFoo.bool(anyString(), anyInt(), any(Object.class))).thenReturn(true);
150-
when(mockFoo.bool(eq("false"), anyInt(), any(Object.class))).thenReturn(false);
151-
when(mockFoo.in(anyBoolean(), anyList())).thenReturn(10);
152-
}
153-
}
154-
""",
155-
"""
156-
package mockito.example;
157-
158-
import java.util.List;
159-
160-
import static org.mockito.ArgumentMatchers.nullable;
161-
import static org.mockito.Mockito.*;
162-
163-
public class MockitoArgumentMatchersTest {
164-
static class Foo {
165-
boolean bool(String str, int i, Object obj) { return false; }
166-
int in(boolean b, List<String> strs) { return 0; }
167-
int bar(byte[] bytes, String[] s, int i) { return 0; }
168-
boolean baz(String ... strings) { return true; }
169-
}
170-
171-
public void usesMatchers() {
172-
Foo mockFoo = mock(Foo.class);
173-
when(mockFoo.bool(nullable(String.class), anyInt(), nullable(Object.class))).thenReturn(true);
174-
when(mockFoo.bool(eq("false"), anyInt(), nullable(Object.class))).thenReturn(false);
175-
when(mockFoo.in(anyBoolean(), anyList())).thenReturn(10);
176-
}
177-
}
178-
"""
179-
)
180-
);
181-
}
182-
183125
/**
184126
* Mockito 1 used Matchers.anyVararg() to match the arguments to a variadic function.
185127
* Mockito 2+ uses Matchers.any() to match anything including the arguments to a variadic function.

0 commit comments

Comments
 (0)