• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mybatis / jpetstore-6 / #1229

pending completion
#1229

push

github

web-flow
Merge pull request #710 from mybatis/renovate/org.apache.maven.plugins-maven-failsafe-plugin-3.x

chore(deps): update dependency org.apache.maven.plugins:maven-failsafe-plugin to v3.1.2

421 of 612 relevant lines covered (68.79%)

0.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/main/java/org/mybatis/jpetstore/domain/Order.java
1
/*
2
 *    Copyright 2010-2022 the original author or authors.
3
 *
4
 *    Licensed under the Apache License, Version 2.0 (the "License");
5
 *    you may not use this file except in compliance with the License.
6
 *    You may obtain a copy of the License at
7
 *
8
 *       https://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *    Unless required by applicable law or agreed to in writing, software
11
 *    distributed under the License is distributed on an "AS IS" BASIS,
12
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *    See the License for the specific language governing permissions and
14
 *    limitations under the License.
15
 */
16
package org.mybatis.jpetstore.domain;
17

18
import java.io.Serializable;
19
import java.math.BigDecimal;
20
import java.util.ArrayList;
21
import java.util.Date;
22
import java.util.Iterator;
23
import java.util.List;
24

25
/**
26
 * The Class Order.
27
 *
28
 * @author Eduardo Macarron
29
 */
30
public class Order implements Serializable {
1✔
31

32
  private static final long serialVersionUID = 6321792448424424931L;
33

34
  private int orderId;
35
  private String username;
36
  private Date orderDate;
37
  private String shipAddress1;
38
  private String shipAddress2;
39
  private String shipCity;
40
  private String shipState;
41
  private String shipZip;
42
  private String shipCountry;
43
  private String billAddress1;
44
  private String billAddress2;
45
  private String billCity;
46
  private String billState;
47
  private String billZip;
48
  private String billCountry;
49
  private String courier;
50
  private BigDecimal totalPrice;
51
  private String billToFirstName;
52
  private String billToLastName;
53
  private String shipToFirstName;
54
  private String shipToLastName;
55
  private String creditCard;
56
  private String expiryDate;
57
  private String cardType;
58
  private String locale;
59
  private String status;
60
  private List<LineItem> lineItems = new ArrayList<>();
1✔
61

62
  public int getOrderId() {
63
    return orderId;
1✔
64
  }
65

66
  public void setOrderId(int orderId) {
67
    this.orderId = orderId;
1✔
68
  }
1✔
69

70
  public String getUsername() {
71
    return username;
1✔
72
  }
73

74
  public void setUsername(String username) {
75
    this.username = username;
1✔
76
  }
1✔
77

78
  public Date getOrderDate() {
79
    return orderDate;
1✔
80
  }
81

82
  public void setOrderDate(Date orderDate) {
83
    this.orderDate = orderDate;
1✔
84
  }
1✔
85

86
  public String getShipAddress1() {
87
    return shipAddress1;
1✔
88
  }
89

90
  public void setShipAddress1(String shipAddress1) {
91
    this.shipAddress1 = shipAddress1;
1✔
92
  }
1✔
93

94
  public String getShipAddress2() {
95
    return shipAddress2;
1✔
96
  }
97

98
  public void setShipAddress2(String shipAddress2) {
99
    this.shipAddress2 = shipAddress2;
1✔
100
  }
1✔
101

102
  public String getShipCity() {
103
    return shipCity;
1✔
104
  }
105

106
  public void setShipCity(String shipCity) {
107
    this.shipCity = shipCity;
1✔
108
  }
1✔
109

110
  public String getShipState() {
111
    return shipState;
1✔
112
  }
113

114
  public void setShipState(String shipState) {
115
    this.shipState = shipState;
1✔
116
  }
1✔
117

118
  public String getShipZip() {
119
    return shipZip;
1✔
120
  }
121

122
  public void setShipZip(String shipZip) {
123
    this.shipZip = shipZip;
1✔
124
  }
1✔
125

126
  public String getShipCountry() {
127
    return shipCountry;
1✔
128
  }
129

130
  public void setShipCountry(String shipCountry) {
131
    this.shipCountry = shipCountry;
1✔
132
  }
1✔
133

134
  public String getBillAddress1() {
135
    return billAddress1;
1✔
136
  }
137

138
  public void setBillAddress1(String billAddress1) {
139
    this.billAddress1 = billAddress1;
1✔
140
  }
1✔
141

142
  public String getBillAddress2() {
143
    return billAddress2;
1✔
144
  }
145

146
  public void setBillAddress2(String billAddress2) {
147
    this.billAddress2 = billAddress2;
1✔
148
  }
1✔
149

150
  public String getBillCity() {
151
    return billCity;
1✔
152
  }
153

154
  public void setBillCity(String billCity) {
155
    this.billCity = billCity;
1✔
156
  }
1✔
157

158
  public String getBillState() {
159
    return billState;
1✔
160
  }
161

162
  public void setBillState(String billState) {
163
    this.billState = billState;
1✔
164
  }
1✔
165

166
  public String getBillZip() {
167
    return billZip;
1✔
168
  }
169

170
  public void setBillZip(String billZip) {
171
    this.billZip = billZip;
1✔
172
  }
1✔
173

174
  public String getBillCountry() {
175
    return billCountry;
1✔
176
  }
177

178
  public void setBillCountry(String billCountry) {
179
    this.billCountry = billCountry;
1✔
180
  }
1✔
181

182
  public String getCourier() {
183
    return courier;
1✔
184
  }
185

186
  public void setCourier(String courier) {
187
    this.courier = courier;
1✔
188
  }
1✔
189

190
  public BigDecimal getTotalPrice() {
191
    return totalPrice;
1✔
192
  }
193

194
  public void setTotalPrice(BigDecimal totalPrice) {
195
    this.totalPrice = totalPrice;
1✔
196
  }
1✔
197

198
  public String getBillToFirstName() {
199
    return billToFirstName;
1✔
200
  }
201

202
  public void setBillToFirstName(String billToFirstName) {
203
    this.billToFirstName = billToFirstName;
1✔
204
  }
1✔
205

206
  public String getBillToLastName() {
207
    return billToLastName;
1✔
208
  }
209

210
  public void setBillToLastName(String billToLastName) {
211
    this.billToLastName = billToLastName;
1✔
212
  }
1✔
213

214
  public String getShipToFirstName() {
215
    return shipToFirstName;
1✔
216
  }
217

218
  public void setShipToFirstName(String shipFoFirstName) {
219
    this.shipToFirstName = shipFoFirstName;
1✔
220
  }
1✔
221

222
  public String getShipToLastName() {
223
    return shipToLastName;
1✔
224
  }
225

226
  public void setShipToLastName(String shipToLastName) {
227
    this.shipToLastName = shipToLastName;
1✔
228
  }
1✔
229

230
  public String getCreditCard() {
231
    return creditCard;
1✔
232
  }
233

234
  public void setCreditCard(String creditCard) {
235
    this.creditCard = creditCard;
1✔
236
  }
1✔
237

238
  public String getExpiryDate() {
239
    return expiryDate;
1✔
240
  }
241

242
  public void setExpiryDate(String expiryDate) {
243
    this.expiryDate = expiryDate;
1✔
244
  }
1✔
245

246
  public String getCardType() {
247
    return cardType;
1✔
248
  }
249

250
  public void setCardType(String cardType) {
251
    this.cardType = cardType;
1✔
252
  }
1✔
253

254
  public String getLocale() {
255
    return locale;
1✔
256
  }
257

258
  public void setLocale(String locale) {
259
    this.locale = locale;
1✔
260
  }
1✔
261

262
  public String getStatus() {
263
    return status;
1✔
264
  }
265

266
  public void setStatus(String status) {
267
    this.status = status;
1✔
268
  }
1✔
269

270
  public void setLineItems(List<LineItem> lineItems) {
271
    this.lineItems = lineItems;
1✔
272
  }
1✔
273

274
  public List<LineItem> getLineItems() {
275
    return lineItems;
1✔
276
  }
277

278
  /**
279
   * Inits the order.
280
   *
281
   * @param account
282
   *          the account
283
   * @param cart
284
   *          the cart
285
   */
286
  public void initOrder(Account account, Cart cart) {
287

288
    username = account.getUsername();
1✔
289
    orderDate = new Date();
1✔
290

291
    shipToFirstName = account.getFirstName();
1✔
292
    shipToLastName = account.getLastName();
1✔
293
    shipAddress1 = account.getAddress1();
1✔
294
    shipAddress2 = account.getAddress2();
1✔
295
    shipCity = account.getCity();
1✔
296
    shipState = account.getState();
1✔
297
    shipZip = account.getZip();
1✔
298
    shipCountry = account.getCountry();
1✔
299

300
    billToFirstName = account.getFirstName();
1✔
301
    billToLastName = account.getLastName();
1✔
302
    billAddress1 = account.getAddress1();
1✔
303
    billAddress2 = account.getAddress2();
1✔
304
    billCity = account.getCity();
1✔
305
    billState = account.getState();
1✔
306
    billZip = account.getZip();
1✔
307
    billCountry = account.getCountry();
1✔
308

309
    totalPrice = cart.getSubTotal();
1✔
310

311
    creditCard = "999 9999 9999 9999";
1✔
312
    expiryDate = "12/03";
1✔
313
    cardType = "Visa";
1✔
314
    courier = "UPS";
1✔
315
    locale = "CA";
1✔
316
    status = "P";
1✔
317

318
    Iterator<CartItem> i = cart.getAllCartItems();
1✔
319
    while (i.hasNext()) {
1✔
320
      CartItem cartItem = i.next();
1✔
321
      addLineItem(cartItem);
1✔
322
    }
1✔
323

324
  }
1✔
325

326
  public void addLineItem(CartItem cartItem) {
327
    LineItem lineItem = new LineItem(lineItems.size() + 1, cartItem);
1✔
328
    addLineItem(lineItem);
1✔
329
  }
1✔
330

331
  public void addLineItem(LineItem lineItem) {
332
    lineItems.add(lineItem);
1✔
333
  }
1✔
334

335
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc