BAEL-2275: Change constructor of Order
This commit is contained in:
@@ -3,11 +3,10 @@ package com.baeldung.ddd.layers.domain;
|
||||
import org.bson.types.ObjectId;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class OrderProvider {
|
||||
public static Order getCreatedOrder() {
|
||||
return new Order(ObjectId.get(), Arrays.asList(new Product(BigDecimal.TEN, "productName")));
|
||||
return new Order(ObjectId.get(), new Product(BigDecimal.TEN, "productName"));
|
||||
}
|
||||
|
||||
public static Order getCompletedOrder() {
|
||||
|
||||
+1
-2
@@ -10,7 +10,6 @@ import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.function.Executable;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
@@ -33,7 +32,7 @@ class DomainOrderServiceUnitTest {
|
||||
void shouldCreateOrder_thenSaveIt() {
|
||||
final Product product = new Product(BigDecimal.TEN, "productName");
|
||||
|
||||
final ObjectId id = tested.createOrder(Arrays.asList(product));
|
||||
final ObjectId id = tested.createOrder(product);
|
||||
|
||||
verify(orderRepository).save(any(Order.class));
|
||||
assertNotNull(id);
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ class MongoDbOrderRepositoryUnitTest {
|
||||
void setUp(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void findById() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user