Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First line lambda breakpoint cause breakpoints to not work #488

Closed
Tracked by #1201
gayanper opened this issue May 25, 2023 · 0 comments
Closed
Tracked by #1201

First line lambda breakpoint cause breakpoints to not work #488

gayanper opened this issue May 25, 2023 · 0 comments

Comments

@gayanper
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant