
Custom JUnit 4 Test Runners
1. Overview In this quick article, we’re going to focus on how to run JUnit tests using custom test runners. Simply put, in order to […]
1. Overview In this quick article, we’re going to focus on how to run JUnit tests using custom test runners. Simply put, in order to […]
1. Overview By default, JUnit runs tests using a deterministic, but unpredictable order (MethodSorters.DEFAULT). In most cases, that behavior is perfectly fine and acceptable; but there’re cases […]
1. Introduction This article is a quick, practical introduction to working with Selenium and writing tests with JUnit and TestNG. 2. Selenium Integration In this section, we’ll start with a […]
1. Overview JUnit and TestNG are undoubtedly the two most popular unit-testing frameworks in the Java ecosystem. While JUnit inspires TestNG itself, it provides its […]
1. Introduction The newly released JUnit 5 is the next version of the well-known testing framework for Java. This version includes a number of features that specifically target […]
1. Introduction In this quick article, we’ll show how to integrate Mockito with the JUnit 5 extension model. To learn more about the JUnit 5 extension […]
1. Introduction In this quick article, we’ll take a look at the new @SpringJUnitConfig and @SpringJUnitWebConfig annotations available in Spring 5. These annotations are a composition of JUnit 5 […]
1. Introduction In this article, we’re going to explore in details the assertions available within JUnit. Following the migrating from JUnit 4 to JUnit 5 and A Guide […]
1. Introduction In this quick tutorial, we’ll be looking at how to test if an exception was thrown using the JUnit library. We will, of […]
1. Overview In this short tutorial, we’re going to explain the differences between the @Before, @BeforeClass, @BeforeEach and @BeforeAll annotations in JUnit 4 and 5 — with practical examples of how […]
1. Overview In this article, we’ll make a quick review of JUnit’s @Test annotation. This annotation provides a powerful tool for performing unit and regression testing. 2. […]
1. Overview JUnit is one of the most popular unit-testing frameworks in the Java ecosystem. The JUnit 5 version contains a number of exciting innovations, with the […]
1. Java String.String() String objects can be created by either using literals: or by calling one of the constructors: If we use the String literal, it’ll try to reuse […]
1. Overview Simply put, the Apache Commons Text library contains a number of useful utility methods for working with Strings, beyond what the core Java offers. […]
1. Remove Special Characters from a String Let’s start by removing all special characters from a String. In the following example, we remove all characters that aren’t […]
1. Overview The Apache Commons Lang 3 library provides support for manipulation of core classes of the Java APIs. This support includes methods for handling strings, numbers, […]
1. Overview In this tutorial, we’ll look at how to convert an InputStream to a String. We’ll start by using plain Java, including Java8/9 solutions, then look into […]
1. Introduction Converting char to String instances is a very common operation. In this article, we will show multiple ways of tackling this situation. 2. String.valueOf() The String class has a […]
1. Introduction Converting a String to an int or Integer is a very common operation in Java. In this article, we will show multiple ways of dealing with this issue. There […]
1. Overview When dealing with Strings in Java, sometimes we need to encode them into a specific charset. This tutorial is a practical guide showing different […]