Skip to content

Package: CucUser

CucUser

nameinstructionbranchcomplexitylinemethod
CucUser()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDisplayName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getEmail()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getExpirationDate()
M: 49 C: 0
0%
M: 6 C: 0
0%
M: 5 C: 0
0%
M: 15 C: 0
0%
M: 1 C: 0
0%
getName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPassword()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPhoneNumber()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getScopeId()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getStatus()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getUserType()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
setDisplayName(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setEmail(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setExpirationDate(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setName(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setPassword(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setPhoneNumber(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setScopeId(BigInteger)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setStatus(UserStatus)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setUserType(UserType)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017, 2020 Eurotech and/or its affiliates and others
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License v1.0
6: * which accompanies this distribution, and is available at
7: * http://www.eclipse.org/legal/epl-v10.html
8: *
9: * Contributors:
10: * Eurotech
11: *******************************************************************************/
12: package org.eclipse.kapua.qa.common.cucumber;
13:
14: import java.math.BigInteger;
15: import java.text.DateFormat;
16: import java.text.ParseException;
17: import java.text.SimpleDateFormat;
18: import java.time.Duration;
19: import java.time.Instant;
20: import java.util.Date;
21:
22: import org.eclipse.kapua.service.user.UserStatus;
23: import org.eclipse.kapua.service.user.UserType;
24:
25: /**
26: * Data object used in Gherkin to transfer User data.
27: */
28: public class CucUser {
29:
30: private String name;
31:
32: private String displayName;
33:
34: private String email;
35:
36: private String phoneNumber;
37:
38: private UserStatus status;
39:
40: private UserType userType;
41:
42: private BigInteger scopeId;
43:
44: private String password;
45:
46: private String expirationDate;
47:
48: public String getName() {
49: return name;
50: }
51:
52: public void setName(String name) {
53: this.name = name;
54: }
55:
56: public String getPassword() {
57: return password;
58: }
59:
60: public void setPassword(String password) {
61: this.password = password;
62: }
63:
64: public String getDisplayName() {
65: return displayName;
66: }
67:
68: public void setDisplayName(String displayName) {
69: this.displayName = displayName;
70: }
71:
72: public String getEmail() {
73: return email;
74: }
75:
76: public void setEmail(String email) {
77: this.email = email;
78: }
79:
80: public String getPhoneNumber() {
81: return phoneNumber;
82: }
83:
84: public void setPhoneNumber(String phoneNumber) {
85: this.phoneNumber = phoneNumber;
86: }
87:
88: public UserStatus getStatus() {
89: return status;
90: }
91:
92: public void setStatus(UserStatus status) {
93: this.status = status;
94: }
95:
96: public UserType getUserType() {
97: return userType;
98: }
99:
100: public void setUserType(UserType userType) {
101: this.userType = userType;
102: }
103:
104: public BigInteger getScopeId() {
105: return scopeId;
106: }
107:
108: public void setScopeId(BigInteger scopeId) {
109: this.scopeId = scopeId;
110: }
111:
112: public Date getExpirationDate() {
113: DateFormat df = new SimpleDateFormat("dd/mm/yyyy");
114: Date expDate = null;
115: Instant now = Instant.now();
116:
117:• if (expirationDate == null) {
118: return null;
119: }
120: // Special keywords for date
121:• switch (expirationDate) {
122: case "yesterday":
123: expDate = Date.from(now.minus(Duration.ofDays(1)));
124: break;
125: case "today":
126: expDate = Date.from(now);
127: break;
128: case "tomorrow":
129: expDate = Date.from(now.plus(Duration.ofDays(1)));
130: break;
131: }
132: // Just parse date
133: try {
134: expDate = df.parse(expirationDate);
135: } catch (ParseException | NullPointerException e) {
136: // skip, leave date null
137: }
138:
139: return expDate;
140: }
141:
142: public void setExpirationDate(String expirationDate) {
143: this.expirationDate = expirationDate;
144: }
145: }