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

DataBiosphere / consent / #5692

18 Apr 2025 02:50PM UTC coverage: 78.932% (-0.02%) from 78.955%
#5692

push

web-flow
DT-1497: Add code to auto-set institution on user creation (#2485)

Institution is no longer selected by user but is assigned based on a user's email address and the DUOS configured domain-to-institution mapping.

52 of 68 new or added lines in 8 files covered. (76.47%)

1 existing line in 1 file now uncovered.

10183 of 12901 relevant lines covered (78.93%)

0.79 hits per line

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

45.45
/src/main/java/org/broadinstitute/consent/http/models/InstitutionDomainMap.java
1
package org.broadinstitute.consent.http.models;
2

3
import java.util.Map;
4
import java.util.Set;
5

6
public class InstitutionDomainMap {
1✔
7

8
  private Map<String, Set<String>> institutionDomainMap;
9

10
  public Map<String, Set<String>> getInstitutionDomainMap() {
11
    return institutionDomainMap;
1✔
12
  }
13

14
  public void setInstitutionDomainMap(Map<String, Set<String>> institutionDomainMap) {
15
    this.institutionDomainMap = institutionDomainMap;
1✔
16
  }
1✔
17

18
  public Set<String> getDomainsForInstitution(String institution) {
19
    return institutionDomainMap.get(institution);
1✔
20
  }
21

22
  public String getInstitutionForEmail(String email) {
NEW
23
    String domain = email.substring(email.indexOf('@') + 1);
×
NEW
24
    return institutionDomainMap.entrySet().stream()
×
NEW
25
        .filter(entry -> entry.getValue().contains(domain))
×
NEW
26
        .map(Map.Entry::getKey)
×
NEW
27
        .findFirst()
×
NEW
28
        .orElse(null);
×
29
  }
30
}
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