Missing doNothing() method
See original GitHub issueI think we should be able to do:
whenever(mock.voidMethod()).thenDoNothing()
I know this is the default behavior for void methods, but this can be used to override previously defined then { }
block.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9
Top Results From Across the Web
Receiving Mockito UnfinishedStubbingException for ...
The doNothing() method from Mockito works a bit different then the standalone when() method. You should be fine by just pushing the method...
Read more >Missing doNothing() method #225 - mockito/mockito-kotlin
I think we should be able to do: whenever(mock.voidMethod()).thenDoNothing() I know this is the default behavior for void methods, ...
Read more >org.mockito.Mockito.doNothing java code examples - Tabnine
How to use. doNothing. method. in. org.mockito.Mockito ... @Test public void testFileManagerInit() throws Exception { FilterFileManagerConfig config = new ...
Read more >Mockito 2.3.4 API - javadoc.io
Mockito verifies argument values in natural java style: by using an equals() method. Sometimes, when extra flexibility is required then you might use...
Read more >Best of Java : ERROR - org.mockito.exceptions.misusing ...
1. missing thenReturn() 2. you are trying to stub a final method, you naughty developer! 3: you are stubbing the behaviour of another...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There is a
doNothing()
function which you place in front of the invocation (like in plain Mockito):See https://github.com/nhaarman/mockito-kotlin/blob/94f17fa8655a672ef00547dc705f6a49c0a992e9/mockito-kotlin/src/test/kotlin/test/MockitoTest.kt#L290
The replacement is https://mockk.io/