• 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/sharedlinksappitems/SharedLinksAppItemsManager.java
1
package com.box.sdkgen.managers.sharedlinksappitems;
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.appitem.AppItem;
15
import com.box.sdkgen.serialization.json.JsonManager;
16
import java.util.Map;
17

18
public class SharedLinksAppItemsManager {
19

20
  public Authentication auth;
21

22
  public NetworkSession networkSession;
23

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

28
  protected SharedLinksAppItemsManager(Builder builder) {
×
29
    this.auth = builder.auth;
×
30
    this.networkSession = builder.networkSession;
×
31
  }
×
32

33
  /**
34
   * Returns the app item represented by a shared link.
35
   *
36
   * <p>The link can originate from the current enterprise or another.
37
   *
38
   * @param headers Headers of findAppItemForSharedLink method
39
   */
40
  public AppItem findAppItemForSharedLink(FindAppItemForSharedLinkHeaders headers) {
41
    Map<String, String> headersMap =
×
42
        prepareParams(
×
43
            mergeMaps(
×
44
                mapOf(entryOf("boxapi", convertToString(headers.getBoxapi()))),
×
45
                headers.getExtraHeaders()));
×
46
    FetchResponse response =
×
47
        this.networkSession
48
            .getNetworkClient()
×
49
            .fetch(
×
50
                new FetchOptions.Builder(
51
                        String.join(
×
52
                            "",
53
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
54
                            "/2.0/shared_items#app_items"),
55
                        "GET")
56
                    .headers(headersMap)
×
57
                    .responseFormat(ResponseFormat.JSON)
×
58
                    .auth(this.auth)
×
59
                    .networkSession(this.networkSession)
×
60
                    .build());
×
61
    return JsonManager.deserialize(response.getData(), AppItem.class);
×
62
  }
63

64
  public Authentication getAuth() {
65
    return auth;
×
66
  }
67

68
  public NetworkSession getNetworkSession() {
69
    return networkSession;
×
70
  }
71

72
  public static class Builder {
73

74
    protected Authentication auth;
75

76
    protected NetworkSession networkSession;
77

NEW
78
    public Builder() {}
×
79

80
    public Builder auth(Authentication auth) {
UNCOV
81
      this.auth = auth;
×
UNCOV
82
      return this;
×
83
    }
84

85
    public Builder networkSession(NetworkSession networkSession) {
UNCOV
86
      this.networkSession = networkSession;
×
UNCOV
87
      return this;
×
88
    }
89

90
    public SharedLinksAppItemsManager build() {
NEW
91
      if (this.networkSession == null) {
×
NEW
92
        this.networkSession = new NetworkSession();
×
93
      }
94
      return new SharedLinksAppItemsManager(this);
×
95
    }
96
  }
97
}
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