-
Notifications
You must be signed in to change notification settings - Fork 173
Closed
Description
Take the following example code
package com.example.demo;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
@ExtendWith(MockitoExtension.class)
class Test {
private List<Integer> mock = mock(List.class);
@Test
void testMain() {
//System.out.println();
when(mock.get(anyInt())).thenAnswer(invocation -> invocation.getArgument(0));
assertEquals(mock.get(0), 0);
}
}
If I try to put a breakpoint at second line of the method, the breakpoint will be skipped, it happens to any line in the method.
But if I uncomment the //System.out.println();
everything is back to normal.
This behavior is observed in both latest release or pre-release versions.
Metadata
Metadata
Assignees
Labels
No labels