Disclosure: This post includes affiliate links; I may receive compensation if you purchase products or services from the different links provided i...
For further actions, you may consider blocking this person and/or reporting abuse
Hi, good list of useful tools. One thing you seem to have missed is AssertJ as an alternative assertion library. It’s fluent API is much more readable and versatile than the standard JUnit assertions. I also think it ships as a transitive dependency with spring testing. So you just need to static import the right methods. I’ve never looked back. 😊
Thanks for suggestion, is it better than Hamcrest? another similar library which provides fluent assertion methods to read your test like English.
Hey, no, Hamcrest is a Matcher Library, AssertJ is an assertion Library, that actually supports Hamcrest matchers and I’m using them as well. It’s a bit complicated... 🤪
Ah I see, I am sure going to try that on my unit tests now. How about mocking, do you use Mockito or PowerMock? I am a big mockito fan but I always stuck with mocking static fields like Logger in some Java classes.
Definitely Mockito. If you need to use PowerMock you’re probably doing something wrong. Why would you ever need to mock the logger?
Great article! 👍
You may also want to check out recheck-web (disclaimer: I'm a contributor). It is a library for Golden Master Testing of web apps, respectively, their UIs, which replaces traditional assertions.
(Also happy to get your feedback.)
Nice one @daniel , will take a look, does it complements Selenium or alternative of that?
It complements Selenium in terms of assertions and locators. Oh, and did I mention it is open source? 😊
That's awesome, it's now on my TODO list to check :-) Once again thanks for suggesting it.
From what little I've seen, the executable Cumcumber/Gherkin style API testing specifications of the Karate testing framework (by Intuit, of 'Quickbooks' fame) look amazing, actually. Quoting them:
The idea is, you use a VERY extended Gherkin syntax (Given-When-Then) specification definition to avoid having to write test code (although Karate does integrate with JUnit, so as to be runnable from an IDE etc.). This means that non-programmers and product owners can concretely define JSON/XML-based payloads, specify endpoint URL's, HTTP verbs and write test validation matchers, again interrogating JSON/XML/etc. return types, all from the specification script, thus:
Nice collection of testing tools!
May I suggest an addition to your list?
You might want to take a look at Citrus, an integration testing framework for various message protocols and data formats.
It supports HTTP REST, JMS, Kafka, SOAP, FTP, SSH, XML, JSON and much more, so it's possible to test you application / microservice fully isolated!
Thank you @Simon Hofmann, I'll sure take a look, looks intereting :-)
Nice article! Thank you very much for the good test info!
your welcome @bob , thanks for your comment.