• 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

84.85
/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) {
1✔
29
    this.auth = builder.auth;
1✔
30
    this.networkSession = builder.networkSession;
1✔
31
  }
1✔
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 =
1✔
42
        prepareParams(
1✔
43
            mergeMaps(
1✔
44
                mapOf(entryOf("boxapi", convertToString(headers.getBoxapi()))),
1✔
45
                headers.getExtraHeaders()));
1✔
46
    FetchResponse response =
1✔
47
        this.networkSession
48
            .getNetworkClient()
1✔
49
            .fetch(
1✔
50
                new FetchOptions.Builder(
51
                        String.join(
1✔
52
                            "",
53
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
54
                            "/2.0/shared_items#app_items"),
55
                        "GET")
56
                    .headers(headersMap)
1✔
57
                    .responseFormat(ResponseFormat.JSON)
1✔
58
                    .auth(this.auth)
1✔
59
                    .networkSession(this.networkSession)
1✔
60
                    .build());
1✔
61
    return JsonManager.deserialize(response.getData(), AppItem.class);
1✔
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

78
    public Builder() {
1✔
79
      this.networkSession = new NetworkSession();
1✔
80
    }
1✔
81

82
    public Builder auth(Authentication auth) {
83
      this.auth = auth;
1✔
84
      return this;
1✔
85
    }
86

87
    public Builder networkSession(NetworkSession networkSession) {
88
      this.networkSession = networkSession;
1✔
89
      return this;
1✔
90
    }
91

92
    public SharedLinksAppItemsManager build() {
93
      return new SharedLinksAppItemsManager(this);
1✔
94
    }
95
  }
96
}
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