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

DataBiosphere / consent / #5046

25 Apr 2024 01:37PM UTC coverage: 76.036% (-0.1%) from 76.14%
#5046

push

web-flow
[DUOS-2660][DCJ-90][risk=no] Service Test MockitoExtension Refactor (#2142)

9557 of 12569 relevant lines covered (76.04%)

0.76 hits per line

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

68.69
/src/main/java/org/broadinstitute/consent/http/models/Election.java
1
package org.broadinstitute.consent.http.models;
2

3
import com.fasterxml.jackson.annotation.JsonInclude;
4
import com.fasterxml.jackson.annotation.JsonInclude.Include;
5
import com.fasterxml.jackson.annotation.JsonProperty;
6
import com.google.common.base.Objects;
7
import java.util.Date;
8
import java.util.HashMap;
9
import java.util.Map;
10

11
@JsonInclude(Include.NON_NULL)
12
public class Election {
13

14
  public static final String QUERY_FIELDS_WITH_E_PREFIX =
15
      " e.election_id AS e_election_id, "
16
          + " e.reference_id AS e_reference_id, "
17
          + " e.status AS e_status, "
18
          + " e.create_date AS e_create_date, "
19
          + " e.last_update AS e_last_update, "
20
          + " e.dataset_id AS e_dataset_id, "
21
          + " e.election_type AS e_election_type, "
22
          + " e.archived AS e_archived, "
23
          + " e.latest AS e_latest ";
24

25
  @JsonProperty
26
  private Integer electionId;
27

28
  @JsonProperty
29
  private String electionType;
30

31
  @JsonProperty
32
  private Boolean finalVote;
33

34
  @JsonProperty
35
  private String status;
36

37
  @JsonProperty
38
  private Date createDate;
39

40
  @JsonProperty
41
  private Date lastUpdate;
42

43
  @JsonProperty
44
  private Date finalVoteDate;
45

46
  @JsonProperty
47
  private String referenceId;
48

49
  @JsonProperty
50
  private String finalRationale;
51

52
  @JsonProperty
53
  private Boolean finalAccessVote;
54

55
  @JsonProperty
56
  private Integer dataSetId;
57

58
  @JsonProperty
59
  private String displayId;
60

61
  @JsonProperty
62
  private String dataUseLetter;
63

64
  @JsonProperty
65
  private String dulName;
66

67
  @JsonProperty
68
  private Boolean archived;
69

70
  @JsonProperty
71
  private Integer version;
72

73
  @JsonProperty
74
  private String consentGroupName;
75

76
  @JsonProperty
77
  private String projectTitle;
78

79
  @JsonProperty
80
  private Map<Integer, Vote> votes;
81

82
  public Election() {
1✔
83
  }
1✔
84

85
  public Election(Integer electionId, String electionType,
86
      String status, Date createDate,
87
      String referenceId, Date lastUpdate, Boolean finalAccessVote, Integer dataSetId) {
×
88
    this.electionId = electionId;
×
89
    this.electionType = electionType;
×
90
    this.status = status;
×
91
    this.createDate = createDate;
×
92
    this.referenceId = referenceId;
×
93
    this.lastUpdate = lastUpdate;
×
94
    this.finalAccessVote = finalAccessVote;
×
95
    this.dataSetId = dataSetId;
×
96
    this.votes = new HashMap<>();
×
97
  }
×
98

99
  public Election(Integer electionId, String electionType,
100
      String status, Date createDate,
101
      String referenceId, Date lastUpdate, Boolean finalAccessVote, Integer dataSetId,
102
      Boolean archived,
103
      String dulName, String dataUseLetter) {
1✔
104
    this.electionId = electionId;
1✔
105
    this.electionType = electionType;
1✔
106
    this.status = status;
1✔
107
    this.createDate = createDate;
1✔
108
    this.referenceId = referenceId;
1✔
109
    this.lastUpdate = lastUpdate;
1✔
110
    this.finalAccessVote = finalAccessVote;
1✔
111
    this.dataSetId = dataSetId;
1✔
112
    this.archived = archived;
1✔
113
    this.dulName = dulName;
1✔
114
    this.dataUseLetter = dataUseLetter;
1✔
115
  }
1✔
116

117
  public Integer getElectionId() {
118
    return electionId;
1✔
119
  }
120

121
  public void setElectionId(Integer electionId) {
122
    this.electionId = electionId;
1✔
123
  }
1✔
124

125
  public String getElectionType() {
126
    return electionType;
1✔
127
  }
128

129
  public void setElectionType(String electionType) {
130
    this.electionType = electionType;
1✔
131
  }
1✔
132

133
  public Boolean getFinalVote() {
134
    return finalVote;
1✔
135
  }
136

137
  public void setFinalVote(Boolean finalVote) {
138
    this.finalVote = finalVote;
1✔
139
  }
1✔
140

141
  public String getStatus() {
142
    return status;
1✔
143
  }
144

145
  public void setStatus(String status) {
146
    this.status = status;
1✔
147
  }
1✔
148

149
  public Date getCreateDate() {
150
    return createDate;
1✔
151
  }
152

153
  public void setCreateDate(Date createDate) {
154
    this.createDate = createDate;
1✔
155
  }
1✔
156

157
  public Date getFinalVoteDate() {
158
    return finalVoteDate;
1✔
159
  }
160

161
  public void setFinalVoteDate(Date finalVoteDate) {
162
    this.finalVoteDate = finalVoteDate;
1✔
163
  }
1✔
164

165
  public String getReferenceId() {
166
    return referenceId;
1✔
167
  }
168

169
  public void setReferenceId(String referenceId) {
170
    this.referenceId = referenceId;
1✔
171
  }
1✔
172

173
  public String getFinalRationale() {
174
    return finalRationale;
×
175
  }
176

177
  public void setFinalRationale(String finalRationale) {
178
    this.finalRationale = finalRationale;
1✔
179
  }
1✔
180

181
  public Boolean getFinalAccessVote() {
182
    return finalAccessVote;
1✔
183
  }
184

185
  public void setFinalAccessVote(Boolean finalAccessVote) {
186
    this.finalAccessVote = finalAccessVote;
1✔
187
  }
1✔
188

189
  public Date getLastUpdate() {
190
    return lastUpdate;
1✔
191
  }
192

193
  public void setLastUpdate(Date lastUpdate) {
194
    this.lastUpdate = lastUpdate;
1✔
195
  }
1✔
196

197
  public Integer getDataSetId() {
198
    return dataSetId;
1✔
199
  }
200

201
  public void setDataSetId(Integer dataSetId) {
202
    this.dataSetId = dataSetId;
1✔
203
  }
1✔
204

205
  public String getDisplayId() {
206
    return displayId;
×
207
  }
208

209
  public void setDisplayId(String displayId) {
210
    this.displayId = displayId;
×
211
  }
×
212

213
  public String getDataUseLetter() {
214
    return dataUseLetter;
×
215
  }
216

217
  public void setDataUseLetter(String dataUseLetter) {
218
    this.dataUseLetter = dataUseLetter;
×
219
  }
×
220

221
  public String getDulName() {
222
    return dulName;
×
223
  }
224

225
  public void setDulName(String dulName) {
226
    this.dulName = dulName;
×
227
  }
×
228

229
  public Boolean getArchived() {
230
    return archived;
1✔
231
  }
232

233
  public void setArchived(Boolean archived) {
234
    this.archived = archived;
1✔
235
  }
1✔
236

237
  public Integer getVersion() {
238
    return version;
×
239
  }
240

241
  public void setVersion(Integer version) {
242
    this.version = version;
1✔
243
  }
1✔
244

245
  public String getConsentGroupName() {
246
    return consentGroupName;
×
247
  }
248

249
  public void setConsentGroupName(String consentGroupName) {
250
    this.consentGroupName = consentGroupName;
×
251
  }
×
252

253
  public String getProjectTitle() {
254
    return projectTitle;
×
255
  }
256

257
  public void setProjectTitle(String projectTitle) {
258
    this.projectTitle = projectTitle;
×
259
  }
×
260

261
  public Map<Integer, Vote> getVotes() {
262
    return votes;
1✔
263
  }
264

265
  public void setVotes(Map<Integer, Vote> votes) {
266
    this.votes = votes;
1✔
267
  }
1✔
268

269
  public void addVote(Vote vote) {
270
    if (java.util.Objects.isNull(votes)) {
1✔
271
      this.setVotes(new HashMap<>());
1✔
272
    }
273
    if (java.util.Objects.nonNull(vote)) {
1✔
274
      Integer voteId = vote.getVoteId();
1✔
275
      Vote savedVote = votes.get(voteId);
1✔
276
      if (java.util.Objects.isNull(savedVote)) {
1✔
277
        votes.put(voteId, vote);
1✔
278
      }
279
    }
280
  }
1✔
281

282
  @Override
283
  public boolean equals(Object o) {
284
    if (this == o) {
1✔
285
      return true;
×
286
    }
287
    if (o == null || getClass() != o.getClass()) {
1✔
288
      return false;
×
289
    }
290
    Election election = (Election) o;
1✔
291
    return Objects.equal(electionId, election.electionId) &&
1✔
292
        Objects.equal(referenceId, election.referenceId);
1✔
293
  }
294

295
  @Override
296
  public int hashCode() {
297
    return Objects.hashCode(electionId, referenceId);
×
298
  }
299

300
}
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