Home » Tag Archives: JUnit

Tag Archives: JUnit

Unit testing of ADF Application using JUnit

JUnit is a unit testing package for Java language and can be used to test Oracle ADF application as ADF is built on top of the J2EE framework. Unit testing is basically is a process to verify the smallest testable module against some defined test criteria. Here I am going to illustrate that how can we set up and use ...

Read More »

Upgrading Spring Security OAuth and JUnit Tests through the πŸ‘€ of a Java Hipster


β€œI love writing authentication and authorization code.” ~ No Java Developer Ever. Tired of building the same login screens over and over? Try the Okta API for hosted authentication, authorization, and multi-factor auth. Using unit and integration tests to verify your code quality is an excellent way to show you care about your code. I recently did a bunch of ...

Read More »

Test Execution Order in JUnit 5

The general practices say that automated tests should be able to run independently and with no specific order as well as the result of the test should not depend on the results of previous tests. But there are situations where a specific order of test execution can be justified, especially in integration or end to end tests. By default, in ...

Read More »

Maven Project Setup for Mixing Spock 1.x and JUnit 5 Tests

I create a sample Groovy project for Maven, that mixes Spock tests and JUnit 5 tests in one project. In the next section I’ll describe how to set up such kind of Maven project. Enable Groovy in the Project First at all, you have to enable Groovy in your project. One possibility is to add the GMavenPlus Plugin to your ...

Read More »

Top 5 Java Test Frameworks For Automation In 2019

For decades, Java has been the most preferred programming language for developing the server side layer of an application. Although JUnit has been there with the developers for helping them in automated unit testing, with time and the evolution of testing, when automation testing is currently on the rise, many open source frameworks have been developed which are based on ...

Read More »

Temporary directories in JUnit 5 Tests

JUnit 4 TemporaryFolder @Rule allowed developers to create tests utilising temporary directories. With JUnit 5, the @Rules are not supported hence testing files and directories required a little bit of additional work. Fortunately, with JUnit 5.4 there is a new built-in extension to handle temporary directories in tests. And it is extremely easy to use. Are you still working with ...

Read More »

Using JUnit 5 In Pre-Java 8 Projects

This post demonstrates how JUnit 5 can be used in pre-Java 8 projects and explains why it could be a good idea. JUnit 5 requires at least Java 8 as runtime environment, so you want to update your whole project to Java 8. But sometimes there exists reason why you can’t immediately update your project to Java 8. For example, ...

Read More »

@ParameterizedTest with null values in @CvsSource

Writing parameterized tests in JUnit 4 was pretty cumbersome. JUnit 5 introduced several useful improvements to the framework and running the same test with different arguments is much simpler than in the previous version. However, there is one small issue with passing null values in such arguments. In this post, I’m going to show you how to pass null in ...

Read More »