Hi Jason,

I heartily support unit testing practices and introducing a mocking
framework into ignite development environment. Today I can hardly find a
single unit test in Apache Ignite, which does not allow me to use the best
TDD and CI/CD practices like running tests on every commit (or even on
every "save file"!).

I recently started developing an isolated component based on Apache Ignite
and, since I use TDD and write lots of unit tests, I had to add a mocking
framework to my project. I started from Mockito (version 1.something) and
found I could not do some things with Mockito due to Ignite currently not
designed for unit testing. I believe I could not find a way to mock some
private initialisation block with Mockito.

Thus, I switched to JMockit - it allowed me to mock what I wanted and it
seems you can mock virtually everything with JMockit.

I know that a situation when you have to mock something private or static
indicates not very modular and extendable design but you do not have much
of a choice with Ignite since you already have huge amount of code and it
would be really hard to refactor everything to make it testable since
Ignite development process is heavy and your project could be stuck waiting
for Ignite changes.

Did you consider JMockit over Mockito? It seems JMockit supports both
record-replay-verity and setup-run-verify models as well as BDD semantics
API.

Reply via email to