Follow BDD Naming Convention
Follow BDD Naming Convention in test cases
This commit is contained in:
parent
aeb33fe72d
commit
4771dc4a3e
|
@ -29,6 +29,11 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -28,28 +28,28 @@ public class SpringDataInjectionDemoApplicationTests {
|
|||
CustomerServiceSetterDI setterDI;
|
||||
|
||||
@Test
|
||||
public void testConstructorDI() {
|
||||
public void givenConstructorDI_whenNumberOfOrdersIsTwo_thenCorrect() {
|
||||
List<Order> orders = constructorDI.getCustomerOrders(1l);
|
||||
Assert.assertNotNull(orders);
|
||||
Assert.assertTrue(orders.size() == 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFieldDI() {
|
||||
public void givenFieldDI_whenNumberOfOrdersIsTwo_thenCorrect() {
|
||||
List<Order> orders = fieldDI.getCustomerOrders(1l);
|
||||
Assert.assertNotNull(orders);
|
||||
Assert.assertTrue(orders.size() == 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetterDI() {
|
||||
public void givenSetterDI_whenNumberOfOrdersIsTwo_thenCorrect() {
|
||||
List<Order> orders = setterDI.getCustomerOrders(1l);
|
||||
Assert.assertNotNull(orders);
|
||||
Assert.assertTrue(orders.size() == 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCombined() {
|
||||
public void givenAllThreeTypesOfDI_whenNumberOfOrdersIsEqualInAll_thenCorrect() {
|
||||
List<Order> ordersSetter = setterDI.getCustomerOrders(1l);
|
||||
List<Order> ordersConstructor = constructorDI.getCustomerOrders(1l);
|
||||
List<Order> ordersField = fieldDI.getCustomerOrders(1l);
|
||||
|
|
Loading…
Reference in New Issue