This post shows how to access the Spring ApplicationContext object in JUnit tests. Now, why would we want to do that? Well, sometimes, we need
Okay, your project has hundreds of unit tests, but you only need to execute one or perhaps only all tests from a JUnit test file.
This post demonstrates how to perform repeated tests in JUnit 4 for this post. It involves creating a class that implements the TestRule interface, another class that implements Statement interface and a new annotation.
This post demonstrates how loading data from an SQL script for a particular database platform. This is ideal for development stage when you need some seed data to fill in existing database tables.
Grouping Unit Tests [wp_ad_camp_5] At times there are certain set of unit tests we want to execute automatically. These tests may be critical or have
If you’re new to Mockito and have only seen a sample or two on the Internet, you might find other examples create mock objects in different ways using the same framework. As a matter of fact, there are three (3) ways to create mock objects in Mockito.
This post shows how to capture arguments our codes passed to a mock’s method. To do this, a method must accept reference types. Then, we
The need for it [wp_ad_camp_5] Finding out if an object is a mock or spy in Mockito may not (or never) be part of your
Spy Objects [wp_ad_camp_5] A Mockito spy allows us to create a spy object from a real object with similar behavior where each method can be
Using @FixMethodOrder [wp_ad_camp_5] To execute tests in a order in JUnit 4, annotate the class with @FixedMethodOrder passing one of enum MethodSorters items as parameter.