Home » Tag Archives: JUnit

Tag Archives: JUnit

Seven Testing Sins and How To Avoid Them

Throughout this article I will be using Java within code snippets, whilst also using JUnit and Mockito. This article aims to provide examples of test code which can be: hard to readdifficult to maintain Following these examples the article will attempt to offer alternatives, which can be used to enhance the readability of your tests, which in turn will help ...

Read More »

Crossing The JUnit Streams

One of the nice things about JUnit 5 migration is that you can run your JUnit 4 tests in vintage mode and everything’s still compatible. One of the down sides is that some of the annotations and methods have the same name in JUnit 4 and JUnit 5 and it’s very easy, when both sets of the library dependencies are ...

Read More »

Testing Spring Boot conditionals the sane way

spring-interview-questions-answers

If you are more or less experienced Spring Boot user, it is very luckily that at some point you may need to run into the situation when the particular beans or configurations have to be injected conditionally. The mechanics of it is well understood but sometimes the testing such conditions (and their combinations) could get messy. In this post we ...

Read More »

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

spring-interview-questions-answers

β€œ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 »