JUnit 5 Test Execution Order

This article shows you how to control the JUnit 5 test execution order via the following MethodOrderer classes: Alphanumeric OrderAnnotation Random Custom Order P.S Tested with JUnit 5.5.2 1. Alphanumeric 1.1 It sorts test methods alphanumerically. MethodAlphanumericTest.java package com.mkyong.order; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import static org.junit.jupiter.api.Assertions.assertEquals; @TestMethodOrder(MethodOrderer.Alphanumeric.class) public class MethodAlphanumericTest { @Test void …

Read more

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. P.S Tested with Spring Boot 2 Console 2019-03-04 13:15:25.151 INFO — [ main] .b.t.c.SpringBootTestContextBootstrapper : 2019-03-04 13:15:25.157 INFO — [ main] o.s.t.c.support.AbstractContextLoader : 2019-03-04 13:15:25.158 INFO — [ main] t.c.s.AnnotationConfigContextLoaderUtils : 2019-03-04 13:15:25.298 INFO — …

Read more

Intellij + Infinitest Continuous Testing

The Infinitest is a continuous testing plugin, it helps to run the test automatically. 1. Install on IntelliJ 1.1 In Plugins, clicks on the “Browse repositories…” 1.2 Type “Infinitest” and clicks on the “Install” button. 1.3 Restart the Intellij IDEA. 2. Add Infinitest facet In the project structure / settings, add a “Infinitest” facet. 3. …

Read more