JUnit Tutorial
JUnit, a popular unit test framework in Java. In this tutorials, all examples are tested with JUnit 4.12 1. JUnit 4.x Examples Maven + JUnit + Hamcrest example Gradle +…
Favourite tutorials for developers
JUnit, a popular unit test framework in Java. In this tutorials, all examples are tested with JUnit 4.12 1. JUnit 4.x Examples Maven + JUnit + Hamcrest example Gradle +…
In this article, we will show you how to develop a Spring Boot web application, using Thymeleaf view, embedded Tomcat and package it as an executable JAR file. Technologies used…
Spring Boot @ConfigurationProperties is letting developer maps the entire .properties and yml file into an object easily. Normally, we use the @Value to inject the .properties value one by one,…
In this article, we will show you how to test the Spring Boot REST application. Normally, we use the MockMvc or TestRestTemplate for the integration test. Technologies used :Spring Boot…
In this article, we will show you error handling in Spring Boot REST application. Technologies used :Spring Boot 2.1.2.RELEASE, Spring 5.1.4.RELEASE, Maven 3, Java 8
In this article, we will enhance the previous Spring REST Hello World example, by adding bean validation and custom validator. Technologies used : Spring Boot 2.1.2.RELEASE, Spring 5.1.4.RELEASE, Maven 3,…
In this tutorial, we will show you how to use Logback in Spring Boot framework. Technologies used : Spring Boot 2.1.2.RELEASE, Spring 5.1.4.RELEASE, Logback 1.2.3, Maven 3, Java 8
Add the following lines in application.properties to log the Hibernate SQL query. To show sql statement: logging.level.org.hibernate.SQL=debug . To show sql values: logging.level.org.hibernate.type.descriptor.sql=trace
Run the Spring Boot integration test or unit test, many annoying DEBUG and INFO logs are displayed in the console. To disable the logs, turn off the logging.level in both…
Review a simple Java application and log a message via Logback. Run above program, the Logback will logs a message twice? This is caused by the Appenders accumulate. To fix…