HttpClient 4 – Cancel Request 1. Overview This quick tutorial shows how to cancel a HTTP Request with the Apache HttpClient 4. This is especially useful for potentially long running requests, or large download files that would otherwise unnecessarily consume bandwidth and connections. If you want to dig deeper and… Continue Reading httpclient-cancel-request

CAS SSO With Spring Security 1. Overview In this article, we’re going to look at integrating the Central Authentication Service (CAS) with Spring Security. CAS is a Single Sign-On (SSO) service. Let’s say we have applications requiring user authentication. The most common method is to implement a security mechanism for… Continue Reading spring-security-cas-sso

JUnit 5 @Test Annotation 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. Maven Configuration To use the latest version of JUnit 5, we’ll need to add the following Maven dependency: <dependency>… Continue Reading junit-5-test-annotation

Retrieving a Class Name in Java 1. Overview In this tutorial, we’ll learn about four ways to retrieve a class’s name from methods on the Class API: getSimpleName(), getName(), getTypeName() and getCanonicalName().  These methods can be confusing because of their similar names and their somewhat vague Javadocs. They also have some nuances when it… Continue Reading java-class-name