diff --git a/SpringDataInjectionDemo/pom.xml b/SpringDataInjectionDemo/pom.xml
index 5b70549079..afb5b985ba 100644
--- a/SpringDataInjectionDemo/pom.xml
+++ b/SpringDataInjectionDemo/pom.xml
@@ -29,6 +29,11 @@
org.springframework.boot
spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+
diff --git a/SpringDataInjectionDemo/src/main/java/com/baeldung/didemo/controller/OrderController.java b/SpringDataInjectionDemo/src/main/java/com/baeldung/didemo/controller/OrderController.java
index f66c1e0928..75a325a6e4 100644
--- a/SpringDataInjectionDemo/src/main/java/com/baeldung/didemo/controller/OrderController.java
+++ b/SpringDataInjectionDemo/src/main/java/com/baeldung/didemo/controller/OrderController.java
@@ -3,6 +3,7 @@ package com.baeldung.didemo.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
diff --git a/SpringDataInjectionDemo/src/test/java/com/baeldung/didemo/SpringDataInjectionDemoApplicationTests.java b/SpringDataInjectionDemo/src/test/java/com/baeldung/didemo/SpringDataInjectionDemoApplicationTests.java
index 23012936c3..c8c0859d25 100644
--- a/SpringDataInjectionDemo/src/test/java/com/baeldung/didemo/SpringDataInjectionDemoApplicationTests.java
+++ b/SpringDataInjectionDemo/src/test/java/com/baeldung/didemo/SpringDataInjectionDemoApplicationTests.java
@@ -28,28 +28,28 @@ public class SpringDataInjectionDemoApplicationTests {
CustomerServiceSetterDI setterDI;
@Test
- public void testConstructorDI() {
+ public void givenConstructorDI_whenNumberOfOrdersIsTwo_thenCorrect() {
List orders = constructorDI.getCustomerOrders(1l);
Assert.assertNotNull(orders);
Assert.assertTrue(orders.size() == 2);
}
@Test
- public void testFieldDI() {
+ public void givenFieldDI_whenNumberOfOrdersIsTwo_thenCorrect() {
List orders = fieldDI.getCustomerOrders(1l);
Assert.assertNotNull(orders);
Assert.assertTrue(orders.size() == 2);
}
@Test
- public void testSetterDI() {
+ public void givenSetterDI_whenNumberOfOrdersIsTwo_thenCorrect() {
List orders = setterDI.getCustomerOrders(1l);
Assert.assertNotNull(orders);
Assert.assertTrue(orders.size() == 2);
}
@Test
- public void testCombined() {
+ public void givenAllThreeTypesOfDI_whenNumberOfOrdersIsEqualInAll_thenCorrect() {
List ordersSetter = setterDI.getCustomerOrders(1l);
List ordersConstructor = constructorDI.getCustomerOrders(1l);
List ordersField = fieldDI.getCustomerOrders(1l);