Home » Tag Archives: JUnit

Tag Archives: JUnit

Spring with Maven Tutorial

spring-interview-questions-answers

1. Introduction In this post, we shall demonstrate how to use Maven dependencies for Spring for very specific use-cases. The latest versions of all the libraries we use can be found on the Maven Central. Understanding how Maven dependencies work and how they are managed, is important in a project for an effective build cycle and the clear concepts about ...

Read More »

Ant 1.10.3 released with JUnit 5 support

We just released 1.9.11 and 1.10.3 versions of Ant today. The downloads are available on the Ant project’s download page. Both these releases are mainly bug fix releases, especially the 1.9.11 version. The 1.10.3 release is an important one for a couple of reasons. The previous 1.10.2 release, unintentionally introduced a bunch of changes which caused regressions in various places in Ant ...

Read More »

Kotlin and JUnit 5 @BeforeAll

Introduction In Kotlin, classes do not have static methods. A Java equivalent semantic can be provided to callers using the concept of a companion object though. This post will go into details of what it takes to support a JUnit 5 @BeforeAll and @AfterAll annotation which depend on the precense of a static methods in test classes. BeforeAll and AfterAll in Java Junit ...

Read More »

JUnit Hamcrest Matcher for JSON

This post shows how you can write JUnit tests to check if an object matches a JSON string. This is important if you are implementing REST services and want to test if your service produces the expected JSON response. A useful library for comparing JSON objects is JSONassert. First, you have to convert your Java object into a JSON string ...

Read More »

Spring Based Application – Migrating to Junit 5

This is a quick write-up on migrating a Gradle based Spring Boot app from Junit 4 to the shiny new Junit 5. Junit 4 tests continue to work with Junit 5 Test Engine abstraction which provides support for tests written in different programming models, in this instance, Junit 5 supports a Vintage Test Engine with the ability to run JUnit 4 ...

Read More »

Android Studio 3.0 – Initial Impressions of Tool Support

I have been using Android Studio 3.0 since since the alpha versions, and it is good to see it finally released. This is just some initial comments on using some common and new Android tools and libraries with the 3.0 version of Android Studio and the associated Android Gradle plugin. Hopefully this will be useful for anyone thinking of upgrading ...

Read More »

JUnit 5 meets AssertJ

JUnit 5 brings a lot of improvements in the assertions library, mainly thanks to Java 8 and Lambda Expression support and thanks to the presence of the new assertions like assertAll, assertTimeout orassertThrows. Although I really like JUnit 5 I believe that AssertJ is still a must in production grade unit tests and I will continue using it. But I ...

Read More »

JUnit 5 – Basics

JUnit 5 is the next generation unit testing framework for Java equipped with many interesting features including nested tests, parameterized tests, new extension API or Java 8 support to mentioned a few. This article shows basic concepts of JUnit 5 including test lifecycle, parameter injection and assertions (basic, timeout and exception). Documentation First of all, JUnit 5 documentation is just ...

Read More »