microsoft / microsoft/vscode-java-debug
Mocked objects are shown as null
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 591
- Forks
- 429
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 19
Description
Vscode 1.79.2
Ubuntu 20.4
@Service
public class Converters {
private final List<String> something.
public Converters() {
this(new ArrayList<>();
}
public Optional<String> do(String v) {
}
}
@ExtendsWith(MockitoExtention.class)
publi class VsCodeDebuggerTest
{
@Mock
public Converters something;
public void shouldDoSomething() {
when(something.do(any())).thenReturn()
something.do("try");
System.out.println(something);
}
}
//with Mock.mock(something); same result,
//but with Mock.mock(something, withSettings.useConstructor(new Object[0]));
//returns non-null,
//however the mocked object in both case is functional.
I have spent quite a few time to debug the source code of the Mockito, as the null was very confusing, even if it was inside a proxy object.
Not sure, what i can expect, but while Mocking repositories, i have seen non-null objects.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the mocked-object display from the issue's Mockito example in VS Code 1.79.2 on Ubuntu 20.4, comparing the default mock with one created using useConstructor. The issue names no source file or test; done would require establishing the intended debugger rendering and confirming the resulting object display is no longer unexpectedly null.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100