java-api
java-api copied to clipboard
Replace Mocks with Fakes in tests
There is a lot of use of Mockito in the tests, it makes it very hard to read and a pain to write.
Using Fakes (see https://www.yegor256.com/2014/09/23/built-in-fake-objects.html) instead would improve the quality of the tests as well as provide a secondary implementation of the main concepts of the Zold java-api, which can only be good for the project.
@llorllale/z please, pay attention to this issue
@victornoel/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!
@llorllale/z please, pay attention to this issue
@victornoel/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!
@0crat status
@victornoel I agree. I personally hate using mockito; let's start fixing this while we're still starting.
Let's start by adding Fake
implementations to our interfaces where needed.
Job #42 is now in scope, role is DEV
The job #42 assigned to @carlosmiranda/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be a monetary reward for this job
@victornoel will implement this after #49, we can use Score.Default
from there to replace some mocks.
@0crat wait for #49, that PR has some useful code we can use here.
@0crat wait for #49, that PR has some useful code we can use here. (here)
@carlosmiranda The impediment for #42 was registered successfully by @carlosmiranda/z
@victornoel see PR #64 please
@carlosmiranda there is also a Mockito usage in TaxesTest
:)
@victornoel you are better off commenting this (https://github.com/zold-io/java-api/issues/42#issuecomment-411422843) in #64 than here. :)
@0crat refuse
@0crat refuse (here)
@carlosmiranda The user @carlosmiranda/z resigned from #42, please stop working. Reason for job resignation: Order was cancelled
@0crat refuse (here)
@carlosmiranda There is an unrecoverable failure on my side. Please, submit it here:
PID: 4@9b7f0750-f619-44d8-bdbc-fcfc0dc4b9ec, thread: pool-3-thread-2
com.zerocracy.Policy[105] java.lang.IllegalArgumentException: Policy item '6.penalty' not found
0.49.18: CID: f41d22b4-8c0e-4a17-a22a-745ff913f2fc, Type: "Order was canceled"