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

box / box-java-sdk / #6242

10 Feb 2026 05:27PM UTC coverage: 35.714% (+11.4%) from 24.324%
#6242

push

github

web-flow
fix(boxsdkgen): Move assigning default values from builder constructor to `build()` method (box/box-codegen#922) (#1712)

0 of 1677 new or added lines in 569 files covered. (0.0%)

2146 existing lines in 544 files now uncovered.

7382 of 20670 relevant lines covered (35.71%)

0.4 hits per line

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

0.0
/src/main/java/com/box/sdkgen/managers/sessiontermination/SessionTerminationManager.java
1
package com.box.sdkgen.managers.sessiontermination;
2

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

7
import com.box.sdkgen.networking.auth.Authentication;
8
import com.box.sdkgen.networking.fetchoptions.FetchOptions;
9
import com.box.sdkgen.networking.fetchoptions.ResponseFormat;
10
import com.box.sdkgen.networking.fetchresponse.FetchResponse;
11
import com.box.sdkgen.networking.network.NetworkSession;
12
import com.box.sdkgen.schemas.sessionterminationmessage.SessionTerminationMessage;
13
import com.box.sdkgen.serialization.json.JsonManager;
14
import java.util.Map;
15

16
public class SessionTerminationManager {
17

18
  public Authentication auth;
19

20
  public NetworkSession networkSession;
21

22
  public SessionTerminationManager() {
×
23
    this.networkSession = new NetworkSession();
×
24
  }
×
25

26
  protected SessionTerminationManager(Builder builder) {
×
27
    this.auth = builder.auth;
×
28
    this.networkSession = builder.networkSession;
×
29
  }
×
30

31
  /**
32
   * Validates the roles and permissions of the user, and creates asynchronous jobs to terminate the
33
   * user's sessions. Returns the status for the POST request.
34
   *
35
   * @param requestBody Request body of terminateUsersSessions method
36
   */
37
  public SessionTerminationMessage terminateUsersSessions(
38
      TerminateUsersSessionsRequestBody requestBody) {
39
    return terminateUsersSessions(requestBody, new TerminateUsersSessionsHeaders());
×
40
  }
41

42
  /**
43
   * Validates the roles and permissions of the user, and creates asynchronous jobs to terminate the
44
   * user's sessions. Returns the status for the POST request.
45
   *
46
   * @param requestBody Request body of terminateUsersSessions method
47
   * @param headers Headers of terminateUsersSessions method
48
   */
49
  public SessionTerminationMessage terminateUsersSessions(
50
      TerminateUsersSessionsRequestBody requestBody, TerminateUsersSessionsHeaders headers) {
51
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
52
    FetchResponse response =
×
53
        this.networkSession
54
            .getNetworkClient()
×
55
            .fetch(
×
56
                new FetchOptions.Builder(
57
                        String.join(
×
58
                            "",
59
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
60
                            "/2.0/users/terminate_sessions"),
61
                        "POST")
62
                    .headers(headersMap)
×
63
                    .data(JsonManager.serialize(requestBody))
×
64
                    .contentType("application/json")
×
65
                    .responseFormat(ResponseFormat.JSON)
×
66
                    .auth(this.auth)
×
67
                    .networkSession(this.networkSession)
×
68
                    .build());
×
69
    return JsonManager.deserialize(response.getData(), SessionTerminationMessage.class);
×
70
  }
71

72
  /**
73
   * Validates the roles and permissions of the group, and creates asynchronous jobs to terminate
74
   * the group's sessions. Returns the status for the POST request.
75
   *
76
   * @param requestBody Request body of terminateGroupsSessions method
77
   */
78
  public SessionTerminationMessage terminateGroupsSessions(
79
      TerminateGroupsSessionsRequestBody requestBody) {
80
    return terminateGroupsSessions(requestBody, new TerminateGroupsSessionsHeaders());
×
81
  }
82

83
  /**
84
   * Validates the roles and permissions of the group, and creates asynchronous jobs to terminate
85
   * the group's sessions. Returns the status for the POST request.
86
   *
87
   * @param requestBody Request body of terminateGroupsSessions method
88
   * @param headers Headers of terminateGroupsSessions method
89
   */
90
  public SessionTerminationMessage terminateGroupsSessions(
91
      TerminateGroupsSessionsRequestBody requestBody, TerminateGroupsSessionsHeaders headers) {
92
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
93
    FetchResponse response =
×
94
        this.networkSession
95
            .getNetworkClient()
×
96
            .fetch(
×
97
                new FetchOptions.Builder(
98
                        String.join(
×
99
                            "",
100
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
101
                            "/2.0/groups/terminate_sessions"),
102
                        "POST")
103
                    .headers(headersMap)
×
104
                    .data(JsonManager.serialize(requestBody))
×
105
                    .contentType("application/json")
×
106
                    .responseFormat(ResponseFormat.JSON)
×
107
                    .auth(this.auth)
×
108
                    .networkSession(this.networkSession)
×
109
                    .build());
×
110
    return JsonManager.deserialize(response.getData(), SessionTerminationMessage.class);
×
111
  }
112

113
  public Authentication getAuth() {
114
    return auth;
×
115
  }
116

117
  public NetworkSession getNetworkSession() {
118
    return networkSession;
×
119
  }
120

121
  public static class Builder {
122

123
    protected Authentication auth;
124

125
    protected NetworkSession networkSession;
126

NEW
127
    public Builder() {}
×
128

129
    public Builder auth(Authentication auth) {
UNCOV
130
      this.auth = auth;
×
UNCOV
131
      return this;
×
132
    }
133

134
    public Builder networkSession(NetworkSession networkSession) {
UNCOV
135
      this.networkSession = networkSession;
×
UNCOV
136
      return this;
×
137
    }
138

139
    public SessionTerminationManager build() {
NEW
140
      if (this.networkSession == null) {
×
NEW
141
        this.networkSession = new NetworkSession();
×
142
      }
143
      return new SessionTerminationManager(this);
×
144
    }
145
  }
146
}
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