From 3daa6b76ec83c4bc7472531351642875ebb9de26 Mon Sep 17 00:00:00 2001 From: Gilbert Ng'eno <45171673+gilly7@users.noreply.github.com> Date: Thu, 31 Mar 2022 08:49:14 +0300 Subject: [PATCH] Update CopsbootApplicationTests.class t's now recommended to specify the class (classes) you would like to test. @SpringBootTest(classes= CopsbootApplicationTests.class) To fix this error: Test Failure : java.lang.IllegalStateException: Failed to load ApplicationContext --- .../java/com/example/copsboot/CopsbootApplicationTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter04/03 - User with JPA refactored/src/test/java/com/example/copsboot/CopsbootApplicationTests.java b/chapter04/03 - User with JPA refactored/src/test/java/com/example/copsboot/CopsbootApplicationTests.java index a9797c6..4b66a40 100644 --- a/chapter04/03 - User with JPA refactored/src/test/java/com/example/copsboot/CopsbootApplicationTests.java +++ b/chapter04/03 - User with JPA refactored/src/test/java/com/example/copsboot/CopsbootApplicationTests.java @@ -6,7 +6,7 @@ import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) -@SpringBootTest +@SpringBootTest(classes= CopsbootApplicationTests.class) public class CopsbootApplicationTests { @Test