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

DataBiosphere / consent / #5486

11 Dec 2024 07:00PM UTC coverage: 79.013% (-0.09%) from 79.101%
#5486

push

web-flow
DT-982: Remove unused SO Support feature (#2435)

1 of 2 new or added lines in 2 files covered. (50.0%)

6 existing lines in 2 files now uncovered.

10233 of 12951 relevant lines covered (79.01%)

0.79 hits per line

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

69.77
/src/main/java/org/broadinstitute/consent/http/models/support/SupportTicket.java
1
package org.broadinstitute.consent.http.models.support;
2

3
import java.util.ArrayList;
4
import java.util.List;
5
import java.util.Objects;
6
import org.broadinstitute.consent.http.enumeration.SupportRequestType;
7

8
/**
9
 * Represents ticket to request support required by the Zendesk API
10
 * https://broadinstitute.zendesk.com/api/v2/requests.json
11
 */
12
public class SupportTicket {
13

14
  private SupportRequest request;
15

16
  /**
17
   * Constructs a ticket with the proper structure to request support via Zendesk
18
   *
19
   * @param name        The name of the user requesting support
20
   * @param type        The type of request ("question", "incident", "problem", "task")
21
   * @param email       The email of the user requesting support
22
   * @param subject     Subject line of the request
23
   * @param description Description of the task or question
24
   * @param url         The API url of this request
25
   */
26
  public SupportTicket(String name, SupportRequestType type, String email, String subject,
27
      String description, String url) {
1✔
28
    if (Objects.isNull(name) || Objects.isNull(email)) {
1✔
29
      throw new IllegalArgumentException("Name and email of user requesting support is required");
×
30
    }
31
    if (Objects.isNull(subject)) {
1✔
32
      throw new IllegalArgumentException("Support ticket subject is required");
×
33
    }
34
    if (Objects.isNull(description)) {
1✔
35
      throw new IllegalArgumentException("Support ticket description is required");
×
36
    }
37
    if (Objects.isNull(type)) {
1✔
38
      throw new IllegalArgumentException("Support ticket type is required");
×
39
    }
40
    if (Objects.isNull(url)) {
1✔
41
      throw new IllegalArgumentException("Support ticket url is required");
×
42
    }
43

44
    this.request = new SupportRequest(name, type, email, subject, description, url);
1✔
45
  }
1✔
46

47

48
  public SupportRequest getRequest() {
49
    return request;
1✔
50
  }
51

52
  public void setRequest(SupportRequest request) {
53
    this.request = request;
×
54
  }
×
55

56

57
  public static class SupportRequest {
58

59
    private SupportRequester requester;
60
    private String subject;
61
    private List<CustomRequestField> customFields;
62
    private SupportRequestComment comment;
63
    private final long ticketFormId = 360000669472L;
1✔
64

65
    public SupportRequest(String name, SupportRequestType type, String email, String subject,
66
        String description, String url) {
1✔
67
      this.requester = new SupportRequester(name, email);
1✔
68
      this.subject = subject;
1✔
69
      this.customFields = createCustomFields(name, type, email, description);
1✔
70
      this.comment = new SupportRequestComment(
1✔
71
          description + "\n\n------------------\nSubmitted from: " + url);
72
    }
1✔
73

74
    public SupportRequester getRequester() {
75
      return requester;
1✔
76
    }
77

78
    public void setRequester(SupportRequester requester) {
79
      this.requester = requester;
×
80
    }
×
81

82
    public String getSubject() {
83
      return subject;
1✔
84
    }
85

86
    public void setSubject(String subject) {
87
      this.subject = subject;
×
88
    }
×
89

90
    public List<CustomRequestField> getCustomFields() {
UNCOV
91
      return customFields;
×
92
    }
93

94
    public void setCustomFields(List<CustomRequestField> customFields) {
95
      this.customFields = customFields;
1✔
96
    }
1✔
97

98
    public SupportRequestComment getComment() {
99
      return comment;
1✔
100
    }
101

102
    public void setComment(SupportRequestComment comment) {
103
      this.comment = comment;
1✔
104
    }
1✔
105

106
    public long getTicketFormId() {
UNCOV
107
      return ticketFormId;
×
108
    }
109

110
    private List<CustomRequestField> createCustomFields(String name, SupportRequestType type,
111
        String email, String description) {
112
      List<CustomRequestField> customFields = new ArrayList<>();
1✔
113
      customFields.add(new CustomRequestField(360012744452L, type.getValue()));
1✔
114
      customFields.add(new CustomRequestField(360007369412L, description));
1✔
115
      customFields.add(new CustomRequestField(360012744292L, name));
1✔
116
      customFields.add(new CustomRequestField(360012782111L, email));
1✔
117
      customFields.add(new CustomRequestField(360018545031L, email));
1✔
118
      return customFields;
1✔
119
    }
120
  }
121
}
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