orderMngmntWebapp\src\orderMngr\domain\order\OrderItem.java
| |
5 | |
package orderMngr.domain.order; |
| |
| |
import java.math.*;
import javax.persistence.*;
import ...
|
| |
10 | |
@Entity |
11 | |
public class OrderItem |
12 | |
{ |
13 | |
@Id @GeneratedValue |
14 | |
private int id; |
| |
16 | |
@ManyToOne |
17 | |
private Order order; |
| |
19 | |
private String productId; |
| |
21 | |
private String productDescription; |
| |
23 | |
private int quantity; |
| |
25 | |
private BigDecimal unitPrice; |
| |
27 | 0 |
public OrderItem() {}
|
| |
29 | |
public OrderItem(String productId, String productDescription, int quantity, BigDecimal unitPrice) |
30 | |
{ |
31 | 13 |
this(null, productId, productDescription, quantity, unitPrice);
- orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
- orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
- orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 40
- orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeOnlyItem: 83
- orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 67
- orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeItemWithInvalidIndex: 96
|
32 | 13 |
}
- orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
- orderMngr.web.submitOrder.OrderEntryPageTest#submitOrder: 26
- orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#submitOrder: 40
- orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeOnlyItem: 83
- orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 67
- orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#removeItemWithInvalidIndex: 96
|
| |
34 | |
public OrderItem( |
35 | |
Order order, String productId, String productDescription, int quantity, BigDecimal unitPrice) |
36 | 19 |
{
- orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
- orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
|
37 | 19 |
this.order = order;
- orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
- orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
|
38 | 19 |
this.productId = productId;
- orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
- orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
|
39 | 19 |
this.productDescription = productDescription;
- orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
- orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
|
40 | 19 |
this.quantity = quantity;
- orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
- orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
|
41 | 19 |
this.unitPrice = unitPrice;
- orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
- orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
|
42 | 19 |
}
- orderMngr.domain.order.OrderFactoryTest#createOrder: 27x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 89x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 81
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 23x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 73
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 32, 58
- orderMngr.domain.order.OrderRepositoryTest#createOrder: 29
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 34
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 105
|
| |
44 | |
public int getId() |
45 | |
{ |
46 | 0 |
return id;
|
47 | |
} |
| |
49 | |
public Order getOrder() |
50 | |
{ |
51 | 0 |
return order;
|
52 | |
} |
| |
54 | |
public String getProductId() |
55 | |
{ |
56 | 7 |
return productId;
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 45
- orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 61x2
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 169
- orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 71
|
57 | |
} |
| |
59 | |
public String getProductDescription() |
60 | |
{ |
61 | 7 |
return productDescription;
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 45
- orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 61x2
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 169
- orderMngr.web.submitOrder.OrderEntryPage_MockupsAPI_Test#addItemToEmptyList: 72
|
62 | |
} |
| |
64 | |
public int getQuantity() |
65 | |
{ |
66 | 17 |
return quantity;
- orderMngr.domain.order.OrderFactoryTest#createOrder: 33x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 83x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 38x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 75x2
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 45
- orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 61x2
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 169
|
67 | |
} |
| |
69 | |
public BigDecimal getUnitPrice() |
70 | |
{ |
71 | 16 |
return unitPrice;
- orderMngr.domain.order.OrderFactoryTest#createOrder: 33x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemUnitPrice: 83x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 38x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithInvalidItemQuantity: 75
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 45
- orderMngr.domain.order.OrderRepositoryTest#createOrder: 32, 34
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#createOrder: 61x2
- orderMngr.domain.order.OrderRepository_MockupsAPI_Test#findOrderByNumber: 169
|
72 | |
} |
| |
74 | |
@Override |
75 | |
public boolean equals(Object o) |
76 | |
{ |
| 6 |
Path coverage: 2/4
A: 4
B: 0
C: 0
D: 2
|
77 | 6 |
if (this == o) return true;
- orderMngr.domain.order.OrderFactoryTest#createOrder: 38x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 41x2
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 63
- orderMngr.domain.order.OrderFactoryTest#createOrder: 38x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 41x2
|
78 | 2 |
if (o == null || getClass() != o.getClass()) return false;
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 63
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 63
|
| |
80 | 2 |
OrderItem orderItem = (OrderItem) o;
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 63
|
| |
82 | 2 |
return productId.equals(orderItem.productId);
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93
- orderMngr.domain.order.OrderFindersTest#findOrderByNumber: 63
|
83 | |
} |
| |
85 | |
@Override |
86 | |
public int hashCode() |
87 | |
{ |
88 | 6 |
return productId.hashCode();
- orderMngr.domain.order.OrderFactoryTest#createOrder: 33x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrderWithDuplicateItem: 93x2
- orderMngr.domain.order.OrderFactory_MockupsAPI_Test#createOrder: 38x2
|
89 | |
} |
90 | |
} |