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

DataBiosphere / consent / #5563

24 Feb 2025 02:51PM UTC coverage: 79.274% (-0.03%) from 79.308%
#5563

push

web-flow
[DT-252][risk=no] Refactor user properties (#2322)

8 of 8 new or added lines in 3 files covered. (100.0%)

9 existing lines in 2 files now uncovered.

10247 of 12926 relevant lines covered (79.27%)

0.79 hits per line

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

56.52
/src/main/java/org/broadinstitute/consent/http/enumeration/UserFields.java
1
package org.broadinstitute.consent.http.enumeration;
2

3
import java.util.ArrayList;
4
import java.util.List;
5
import java.util.stream.Collectors;
6
import java.util.stream.Stream;
7

8
public enum UserFields {
1✔
9
  ERA_EXPIRATION_DATE("eraExpiration", false),
1✔
10
  ERA_STATUS("eraAuthorized", false),
1✔
11
  SELECTED_SIGNING_OFFICIAL_ID("selectedSigningOfficialId", false),
1✔
12
  SUGGESTED_SIGNING_OFFICIAL("suggestedSigningOfficial", false),
1✔
13
  SUGGESTED_INSTITUTION("suggestedInstitution", false),
1✔
14
  DAA_ACCEPTANCE("daaAcceptance", false);
1✔
15

16
  public static final String LIBRARY_CARDS = "libraryCards";
17
  public static final String LIBRARY_CARD_ENTRIES = "libraryCardEntries";
18
  private final String value;
19
  private final Boolean required;
20

21
  UserFields(String value, Boolean required) {
1✔
22
    this.value = value;
1✔
23
    this.required = required;
1✔
24
  }
1✔
25

26
  public String getValue() {
27
    return value;
1✔
28
  }
29

30
  public static List<String> getValues() {
31
    return Stream.of(UserFields.values()).map(UserFields::getValue).collect(Collectors.toList());
1✔
32
  }
33

34
  public Boolean getRequired() {
UNCOV
35
    return required;
×
36
  }
37

38
  public static List<UserFields> getRequiredFields() {
UNCOV
39
    List<UserFields> requiredValues = new ArrayList<>();
×
UNCOV
40
    for (UserFields researcherField : UserFields.values()) {
×
UNCOV
41
      if (researcherField.getRequired()) {
×
42
        requiredValues.add(researcherField);
×
43
      }
44
    }
UNCOV
45
    return requiredValues;
×
46
  }
47

48
  public static Boolean containsValue(String value) {
UNCOV
49
    for (UserFields researcherField : UserFields.values()) {
×
UNCOV
50
      if (researcherField.getValue().equals(value)) {
×
UNCOV
51
        return true;
×
52
      }
53
    }
54
    return false;
×
55
  }
56
}
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