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

Replace Mocks with Fakes in tests

Open victornoel opened this issue 6 years ago • 19 comments

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.

victornoel avatar Jul 21 '18 09:07 victornoel

@llorllale/z please, pay attention to this issue

0crat avatar Jul 21 '18 09:07 0crat

@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 avatar Jul 21 '18 09:07 0crat

@llorllale/z please, pay attention to this issue

0crat avatar Jul 21 '18 09:07 0crat

@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 avatar Jul 21 '18 09:07 0crat

@0crat status

g4s8 avatar Jul 21 '18 10:07 g4s8

@0crat status (here)

@g4s8 This is what I know about this job in CAZUREFND, as in §32:

  • The job #42 is not in scope
  • Job footprint (restricted area)

0crat avatar Jul 21 '18 10:07 0crat

@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.

llorllale avatar Jul 21 '18 19:07 llorllale

Job #42 is now in scope, role is DEV

0crat avatar Jul 21 '18 19:07 0crat

Bug was reported, see §29: +15 point(s) just awarded to @victornoel/z

0crat avatar Jul 21 '18 19:07 0crat

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

0crat avatar Jul 22 '18 06:07 0crat

@victornoel will implement this after #49, we can use Score.Default from there to replace some mocks.

carlosmiranda avatar Jul 27 '18 03:07 carlosmiranda

@0crat wait for #49, that PR has some useful code we can use here.

carlosmiranda avatar Jul 27 '18 03:07 carlosmiranda

@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

0crat avatar Jul 27 '18 04:07 0crat

@victornoel see PR #64 please

carlosmiranda avatar Aug 08 '18 04:08 carlosmiranda

@carlosmiranda there is also a Mockito usage in TaxesTest :)

victornoel avatar Aug 08 '18 14:08 victornoel

@victornoel you are better off commenting this (https://github.com/zold-io/java-api/issues/42#issuecomment-411422843) in #64 than here. :)

carlosmiranda avatar Aug 09 '18 00:08 carlosmiranda

@0crat refuse

carlosmiranda avatar Oct 11 '19 02:10 carlosmiranda

@0crat refuse (here)

@carlosmiranda The user @carlosmiranda/z resigned from #42, please stop working. Reason for job resignation: Order was cancelled

0crat avatar Oct 11 '19 02:10 0crat

@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"

0crat avatar Oct 11 '19 02:10 0crat