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

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 hits per line

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

86.54
/src/main/java/com/box/sdkgen/managers/signtemplates/SignTemplatesManager.java
1
package com.box.sdkgen.managers.signtemplates;
2

3
import static com.box.sdkgen.internal.utils.UtilsManager.convertToString;
4
import static com.box.sdkgen.internal.utils.UtilsManager.entryOf;
5
import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
6
import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps;
7
import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams;
8

9
import com.box.sdkgen.networking.auth.Authentication;
10
import com.box.sdkgen.networking.fetchoptions.FetchOptions;
11
import com.box.sdkgen.networking.fetchoptions.ResponseFormat;
12
import com.box.sdkgen.networking.fetchresponse.FetchResponse;
13
import com.box.sdkgen.networking.network.NetworkSession;
14
import com.box.sdkgen.schemas.signtemplate.SignTemplate;
15
import com.box.sdkgen.schemas.signtemplates.SignTemplates;
16
import com.box.sdkgen.serialization.json.JsonManager;
17
import java.util.Map;
18

19
public class SignTemplatesManager {
20

21
  public Authentication auth;
22

23
  public NetworkSession networkSession;
24

25
  public SignTemplatesManager() {
×
26
    this.networkSession = new NetworkSession();
×
27
  }
×
28

29
  protected SignTemplatesManager(Builder builder) {
1✔
30
    this.auth = builder.auth;
1✔
31
    this.networkSession = builder.networkSession;
1✔
32
  }
1✔
33

34
  /** Gets Box Sign templates created by a user. */
35
  public SignTemplates getSignTemplates() {
36
    return getSignTemplates(new GetSignTemplatesQueryParams(), new GetSignTemplatesHeaders());
×
37
  }
38

39
  /**
40
   * Gets Box Sign templates created by a user.
41
   *
42
   * @param queryParams Query parameters of getSignTemplates method
43
   */
44
  public SignTemplates getSignTemplates(GetSignTemplatesQueryParams queryParams) {
45
    return getSignTemplates(queryParams, new GetSignTemplatesHeaders());
1✔
46
  }
47

48
  /**
49
   * Gets Box Sign templates created by a user.
50
   *
51
   * @param headers Headers of getSignTemplates method
52
   */
53
  public SignTemplates getSignTemplates(GetSignTemplatesHeaders headers) {
54
    return getSignTemplates(new GetSignTemplatesQueryParams(), headers);
×
55
  }
56

57
  /**
58
   * Gets Box Sign templates created by a user.
59
   *
60
   * @param queryParams Query parameters of getSignTemplates method
61
   * @param headers Headers of getSignTemplates method
62
   */
63
  public SignTemplates getSignTemplates(
64
      GetSignTemplatesQueryParams queryParams, GetSignTemplatesHeaders headers) {
65
    Map<String, String> queryParamsMap =
1✔
66
        prepareParams(
1✔
67
            mapOf(
1✔
68
                entryOf("marker", convertToString(queryParams.getMarker())),
1✔
69
                entryOf("limit", convertToString(queryParams.getLimit()))));
1✔
70
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
71
    FetchResponse response =
1✔
72
        this.networkSession
73
            .getNetworkClient()
1✔
74
            .fetch(
1✔
75
                new FetchOptions.Builder(
76
                        String.join(
1✔
77
                            "",
78
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
79
                            "/2.0/sign_templates"),
80
                        "GET")
81
                    .params(queryParamsMap)
1✔
82
                    .headers(headersMap)
1✔
83
                    .responseFormat(ResponseFormat.JSON)
1✔
84
                    .auth(this.auth)
1✔
85
                    .networkSession(this.networkSession)
1✔
86
                    .build());
1✔
87
    return JsonManager.deserialize(response.getData(), SignTemplates.class);
1✔
88
  }
89

90
  /**
91
   * Fetches details of a specific Box Sign template.
92
   *
93
   * @param templateId The ID of a Box Sign template. Example:
94
   *     "123075213-7d117509-8f05-42e4-a5ef-5190a319d41d"
95
   */
96
  public SignTemplate getSignTemplateById(String templateId) {
97
    return getSignTemplateById(templateId, new GetSignTemplateByIdHeaders());
1✔
98
  }
99

100
  /**
101
   * Fetches details of a specific Box Sign template.
102
   *
103
   * @param templateId The ID of a Box Sign template. Example:
104
   *     "123075213-7d117509-8f05-42e4-a5ef-5190a319d41d"
105
   * @param headers Headers of getSignTemplateById method
106
   */
107
  public SignTemplate getSignTemplateById(String templateId, GetSignTemplateByIdHeaders headers) {
108
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
109
    FetchResponse response =
1✔
110
        this.networkSession
111
            .getNetworkClient()
1✔
112
            .fetch(
1✔
113
                new FetchOptions.Builder(
114
                        String.join(
1✔
115
                            "",
116
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
117
                            "/2.0/sign_templates/",
118
                            convertToString(templateId)),
1✔
119
                        "GET")
120
                    .headers(headersMap)
1✔
121
                    .responseFormat(ResponseFormat.JSON)
1✔
122
                    .auth(this.auth)
1✔
123
                    .networkSession(this.networkSession)
1✔
124
                    .build());
1✔
125
    return JsonManager.deserialize(response.getData(), SignTemplate.class);
1✔
126
  }
127

128
  public Authentication getAuth() {
129
    return auth;
×
130
  }
131

132
  public NetworkSession getNetworkSession() {
133
    return networkSession;
×
134
  }
135

136
  public static class Builder {
137

138
    protected Authentication auth;
139

140
    protected NetworkSession networkSession;
141

142
    public Builder() {
1✔
143
      this.networkSession = new NetworkSession();
1✔
144
    }
1✔
145

146
    public Builder auth(Authentication auth) {
147
      this.auth = auth;
1✔
148
      return this;
1✔
149
    }
150

151
    public Builder networkSession(NetworkSession networkSession) {
152
      this.networkSession = networkSession;
1✔
153
      return this;
1✔
154
    }
155

156
    public SignTemplatesManager build() {
157
      return new SignTemplatesManager(this);
1✔
158
    }
159
  }
160
}
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