Friday, June 23, 2017

Remote debugging Wildfly application in IntelliJ

Remote debugging a Java application means connecting to the remotely running application using your local development environment. Java supports remote debugging out of the box: the target application must be executed with -agentlib:jdwp[=options] option which loads Java Debug Wire Protocol (jdwp) library that allows remote debugging using for example socket connection. In this short article you will learn how to get started with debugging web application deployed to Wildfly server by using IntelliJ.

Thursday, June 8, 2017

Cleaner parameterized tests with JUnit 5

The general idea of parameterized unit tests is to run the same test method for different data.
Creating parameterized tests in JUnit 4 is far from being perfect. There are many issues with the existing architecture: parameters are defined as class fields and constructor is needed to create them, parameterized and non-parameterized tests cannot be mixed in one test class and built-in data sources are very limited. Fortunately, all of this is improved in JUnit 5!

Tuesday, June 6, 2017

Testing exceptions with JUnit 5

JUnit 5 brought pretty awesome improvements and it differs a lot from its predecessor. JUnit 5 requires Java 8 at runtime hence Lambda expressions can be used in tests, especially in assertions. One of those assertions is perfectly suited for testing exceptions.

Tuesday, April 25, 2017

Friday, March 17, 2017

Spring Boot and Security Events with Actuator

Spring Boot Actuator provides auditing capabilities for publishing and listening to security related events in a Spring Boot application with Spring Security enabled. The default events are authentication success, authentication failure and access denied, but they can be extended with custom events.

Tuesday, March 7, 2017

Monday, March 6, 2017