Add junit-mockito module: 30 runnable JUnit 6.1.3 / Mockito 5.24.0 interview answers
One test per question, each writing and asserting its own transcript under output/. Covers lifecycle, extensions, parameterized and dynamic tests, mocks vs spies, verification, strict stubs, static and constructor mocking, and flaky tests. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CifR2BE7PBvRy5hT8TS9oz
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
times / atLeastOnce / never / inOrder: all passed
|
||||
--- verify(gw).lookup("zzz") ---
|
||||
Wanted but not invoked:
|
||||
paymentGateway.lookup("zzz");
|
||||
--- verify(gw).audit("declined c") ---
|
||||
Argument(s) are different! Wanted:
|
||||
paymentGateway.audit("declined c");
|
||||
-> at lab.jm.D_MockitoCoreTest.lambda$q20_verify$1(D_MockitoCoreTest.java:90)
|
||||
Actual invocations have different arguments:
|
||||
paymentGateway.charge("a", 500L);
|
||||
-> at lab.jm.OrderService.place(OrderService.java:17)
|
||||
--- verify(gw, never()).audit("declined b") ---
|
||||
paymentGateway.audit("declined b");
|
||||
Never wanted here:
|
||||
Reference in New Issue
Block a user