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

DataBiosphere / consent / #4990

17 Apr 2024 02:26PM UTC coverage: 76.054% (+0.2%) from 75.873%
#4990

push

web-flow
[DUOS-2952] POST DAA request API (#2283)

Co-authored-by: Florian Boulnois <fboulnoi@broadinstitute.org>

68 of 69 new or added lines in 10 files covered. (98.55%)

1 existing line in 1 file now uncovered.

9544 of 12549 relevant lines covered (76.05%)

0.76 hits per line

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

81.03
/src/main/java/org/broadinstitute/consent/http/models/LibraryCard.java
1
package org.broadinstitute.consent.http.models;
2

3
import java.util.ArrayList;
4
import java.util.Date;
5
import java.util.List;
6
import org.apache.commons.lang3.builder.EqualsBuilder;
7

8
public class LibraryCard {
9

10
  public static final String QUERY_FIELDS_WITH_LC_PREFIX =
11
      " lc.id AS lc_id, " +
12
          " lc.user_id AS lc_user_id, " +
13
          " lc.institution_id AS lc_institution_id, " +
14
          " lc.era_commons_id AS lc_era_commons_id, " +
15
          " lc.user_name AS lc_user_name, " +
16
          " lc.user_email AS lc_user_email, " +
17
          " lc.create_user_id AS lc_create_user_id, " +
18
          " lc.create_date AS lc_create_date, " +
19
          " lc.update_user_id AS lc_update_user_id ";
20

21
  private Integer id;
22
  private Integer userId;
23
  private Integer institutionId;
24
  private String eraCommonsId;
25
  private String userName;
26
  private String userEmail;
27
  private Date createDate;
28
  private Integer createUserId;
29
  private Date updateDate;
30
  private Integer updateUserId;
31

32
  private Institution institution;
33

34
  private List<Integer> daaIds;
35

36
  public LibraryCard() {
1✔
37
    this.createDate = new Date();
1✔
38
    this.daaIds = new ArrayList<>();
1✔
39
  }
1✔
40

41
  public Integer getId() {
42
    return id;
1✔
43
  }
44

45
  public void setId(Integer id) {
46
    this.id = id;
1✔
47
  }
1✔
48

49
  public Integer getUserId() {
50
    return userId;
1✔
51
  }
52

53
  public void setUserId(Integer userId) {
54
    this.userId = userId;
1✔
55
  }
1✔
56

57
  public Integer getInstitutionId() {
58
    return institutionId;
1✔
59
  }
60

61
  public void setInstitutionId(Integer institutionId) {
62
    this.institutionId = institutionId;
1✔
63
  }
1✔
64

65
  public String getEraCommonsId() {
66
    return eraCommonsId;
1✔
67
  }
68

69
  public void setEraCommonsId(String eraCommonsId) {
70
    this.eraCommonsId = eraCommonsId;
1✔
71
  }
1✔
72

73
  public String getUserName() {
74
    return userName;
1✔
75
  }
76

77
  public void setUserName(String name) {
78
    this.userName = name;
1✔
79
  }
1✔
80

81
  public String getUserEmail() {
82
    return userEmail;
1✔
83
  }
84

85
  public void setUserEmail(String email) {
86
    this.userEmail = email;
1✔
87
  }
1✔
88

89
  public Date getCreateDate() {
90
    return createDate;
1✔
91
  }
92

93
  public void setCreateDate(Date createDate) {
94
    this.createDate = createDate;
1✔
95
  }
1✔
96

97
  public Integer getCreateUserId() {
98
    return createUserId;
1✔
99
  }
100

101
  public void setCreateUserId(Integer createUser) {
102
    this.createUserId = createUser;
1✔
103
  }
1✔
104

105
  public Date getUpdateDate() {
106
    return updateDate;
×
107
  }
108

109
  public void setUpdateDate(Date updateDate) {
110
    this.updateDate = updateDate;
1✔
111
  }
1✔
112

113
  public Integer getUpdateUserId() {
114
    return updateUserId;
1✔
115
  }
116

117
  public void setUpdateUserId(Integer updateUser) {
118
    this.updateUserId = updateUser;
1✔
119
  }
1✔
120

121
  public Institution getInstitution() {
122
    return institution;
1✔
123
  }
124

125
  public void setInstitution(Institution institution) {this.institution = institution;}
1✔
126

127
  public List<Integer> getDaaIds() {return daaIds;}
1✔
128

129
  public void setDaaIds(List<Integer> daaIds) {this.daaIds = daaIds;}
1✔
130

131
  @Override
132
  public boolean equals(Object libraryCard) {
133
    if (libraryCard == this) {
1✔
134
      return true;
×
135
    }
136
    if (libraryCard == null || libraryCard.getClass() != getClass()) {
1✔
137
      return false;
×
138
    }
139
    LibraryCard other = (LibraryCard) libraryCard;
1✔
140
    return new EqualsBuilder().append(id, other.getId()).isEquals();
1✔
141
  }
142

143
  public void addDaa(Integer daaId) {
144
    if (this.daaIds == null) {
1✔
UNCOV
145
      this.daaIds = new ArrayList<>();
×
146
    }
147
    if (this.daaIds
1✔
148
        .stream()
1✔
149
        .noneMatch(d -> d.equals(daaId))) {
1✔
150
      this.daaIds.add(daaId);
1✔
151
    }
152
  }
1✔
153

154
  public void removeDaa(Integer daaId) {
155
    if (this.daaIds == null) {
×
156
      return;
×
157
    }
158
    if (this.daaIds
×
159
        .stream()
×
160
        .anyMatch(d -> d.equals(daaId))) {
×
161
      this.daaIds.remove(daaId);
×
162
    }
163
  }
×
164
}
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

© 2026 Coveralls, Inc