-
Spring Batch unit test example
In this tutorial, we will show you how to unit test Spring batch jobs with jUnit and TestNG frameworks. To unit test batch job, declares spring-batch-test.jar, @autowired the JobLauncherTestUtils, launch the job or step, and assert the execution status.
Date: 2019-08-18 View: 1520
-
NoSuchBeanDefinitionException : No qualifying bean of type JobLauncherTestUtils
Following the official Spring batch unit testing guide to create a standard unit test case.
Date: 2019-08-18 View: 1520
-
Ant and TestNG Task example
In this tutorial, we will show you how to run a TestNG test in Ant build.
Date: 2019-08-18 View: 1520
-
Gradle How to skip unit test
Be default, Gradle build is abort if any unit tests is failed. Oftentimes, we still need to build the project even the unit test is failed.
Date: 2019-08-18 View: 1520
-
Java Custom Annotations Example
In this tutorial, we will show you how to create two custom annotations – @Test and @TestInfo, to simulate a simple unit test framework.
Date: 2019-08-17 View: 1520
-
Must include junit.jar if not in Ants own classpath
Declares a junit task in Ant like this
Date: 2019-08-17 View: 1520
-
Ant and jUnit Task example
In this tutorial, we will show you how to run a junit test in Ant build.
Date: 2019-08-17 View: 1520
-
Logback Disable logging in Unit Test
While the unit test is running in the IDE, the Logback is showing a lot of configuration or status like this :
Date: 2019-08-17 View: 1520
-
Unit Test What is Mocking? and Why?
In simple, mocking is creating objects that mimic the behavior of real objects. Refer to the following case study :
Date: 2019-08-17 View: 1520
-
Spring Boot Test How to disable DEBUG and INFO logs
Run the Spring Boot integration test or unit test, many annoying DEBUG and INFO logs are displayed in the console.
Date: 2019-08-11 View: 1520
-
Spring WebFlux Test Timeout on blocking read for 5000 MILLISECONDS
Test a Spring Webflux endpoint with the WebTestClient, and hits the following error messages. Is this possible to increase the timeout?
Date: 2019-08-11 View: 1520
-
Spring Boot + JUnit 5 + Mockito
In this article, we will show you how to do Spring Boot 2 integration test with JUnit 5, and also Mockito.
Date: 2019-08-11 View: 1520
-
Spring REST + Spring Security Example
In this article, we will enhance the previous Spring REST Validation Example, by adding Spring Security to perform authentication and authorization for the requested URLs (REST API endpoints)
Date: 2019-08-11 View: 1520
-
JSONAssert How to unit test JSON data
In Java, we can use JSONAssert to unit test JSON data easily.
Date: 2019-08-11 View: 1520
-
Spring Boot How to init a Bean for testing?
In Spring Boot, we can create a @TestConfiguration class to initialize some beans for testing class only.
Date: 2019-08-11 View: 1520