vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Support debug on SpyBeans

Open raulvaldoleirospowerdot opened this issue 1 year ago • 7 comments

Can't debug a class annotated with SpyBean annotation, this makes hard to debug testes because I need to comment the annotation and all the verify statements.

I uploaded a project as sample, if you uncomment the SpyBean annotation you will be able to debug it.

sample-project.zip

Thanks

raulvaldoleirospowerdot avatar May 15 '24 16:05 raulvaldoleirospowerdot

~~I can't reproduce the issue.~~ spybean

snjeza avatar May 15 '24 17:05 snjeza

Sorry, I forgot to mention the class.

Can you try to add the breakpoint on line 9 of ComponentSample class please?

raulvaldoleirospowerdot avatar May 15 '24 17:05 raulvaldoleirospowerdot

I can reproduce the issue in Eclipse too.

snjeza avatar May 15 '24 18:05 snjeza

That means the fix should be done first in eclipse and then raise the version on vscode java? Just to understand the process 😀 Thanks

raulvaldoleirospowerdot avatar May 16 '24 00:05 raulvaldoleirospowerdot

Yes, it's a possibility that the issue is in a component coming from JDT (and not JDT-LS). @snjeza is there anything in the client/server logs to indicate what the failure might be ?

rgrunber avatar May 21 '24 12:05 rgrunber

See workaround from this stackoverflow post https://stackoverflow.com/questions/61775881/eclipse-mockito-debugging-doesnt-stop-on-breakpoints-in-spied-beans

e-dong avatar Sep 18 '24 17:09 e-dong

Has anyone raised the issue in Eclipse?

e-dong avatar Sep 19 '24 03:09 e-dong

See workaround from this stackoverflow post https://stackoverflow.com/questions/61775881/eclipse-mockito-debugging-doesnt-stop-on-breakpoints-in-spied-beans

Tihs worked for me in vscode, thanks.

jacknight avatar Dec 16 '24 08:12 jacknight