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

box / box-java-sdk / #6244

10 Feb 2026 05:27PM UTC coverage: 40.749% (+22.6%) from 18.192%
#6244

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 18116 relevant lines covered (40.75%)

0.46 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/recentitems/RecentItemsManager.java
1
package com.box.sdkgen.managers.recentitems;
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.recentitems.RecentItems;
15
import com.box.sdkgen.serialization.json.JsonManager;
16
import java.util.Map;
17

18
public class RecentItemsManager {
19

20
  public Authentication auth;
21

22
  public NetworkSession networkSession;
23

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

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

33
  /**
34
   * Returns information about the recent items accessed by a user, either in the last 90 days or up
35
   * to the last 1000 items accessed.
36
   */
37
  public RecentItems getRecentItems() {
38
    return getRecentItems(new GetRecentItemsQueryParams(), new GetRecentItemsHeaders());
×
39
  }
40

41
  /**
42
   * Returns information about the recent items accessed by a user, either in the last 90 days or up
43
   * to the last 1000 items accessed.
44
   *
45
   * @param queryParams Query parameters of getRecentItems method
46
   */
47
  public RecentItems getRecentItems(GetRecentItemsQueryParams queryParams) {
48
    return getRecentItems(queryParams, new GetRecentItemsHeaders());
×
49
  }
50

51
  /**
52
   * Returns information about the recent items accessed by a user, either in the last 90 days or up
53
   * to the last 1000 items accessed.
54
   *
55
   * @param headers Headers of getRecentItems method
56
   */
57
  public RecentItems getRecentItems(GetRecentItemsHeaders headers) {
58
    return getRecentItems(new GetRecentItemsQueryParams(), headers);
×
59
  }
60

61
  /**
62
   * Returns information about the recent items accessed by a user, either in the last 90 days or up
63
   * to the last 1000 items accessed.
64
   *
65
   * @param queryParams Query parameters of getRecentItems method
66
   * @param headers Headers of getRecentItems method
67
   */
68
  public RecentItems getRecentItems(
69
      GetRecentItemsQueryParams queryParams, GetRecentItemsHeaders headers) {
70
    Map<String, String> queryParamsMap =
×
71
        prepareParams(
×
72
            mapOf(
×
73
                entryOf("fields", convertToString(queryParams.getFields())),
×
74
                entryOf("limit", convertToString(queryParams.getLimit())),
×
75
                entryOf("marker", convertToString(queryParams.getMarker()))));
×
76
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
77
    FetchResponse response =
×
78
        this.networkSession
79
            .getNetworkClient()
×
80
            .fetch(
×
81
                new FetchOptions.Builder(
82
                        String.join(
×
83
                            "",
84
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
85
                            "/2.0/recent_items"),
86
                        "GET")
87
                    .params(queryParamsMap)
×
88
                    .headers(headersMap)
×
89
                    .responseFormat(ResponseFormat.JSON)
×
90
                    .auth(this.auth)
×
91
                    .networkSession(this.networkSession)
×
92
                    .build());
×
93
    return JsonManager.deserialize(response.getData(), RecentItems.class);
×
94
  }
95

96
  public Authentication getAuth() {
97
    return auth;
×
98
  }
99

100
  public NetworkSession getNetworkSession() {
101
    return networkSession;
×
102
  }
103

104
  public static class Builder {
105

106
    protected Authentication auth;
107

108
    protected NetworkSession networkSession;
109

NEW
110
    public Builder() {}
×
111

112
    public Builder auth(Authentication auth) {
UNCOV
113
      this.auth = auth;
×
UNCOV
114
      return this;
×
115
    }
116

117
    public Builder networkSession(NetworkSession networkSession) {
UNCOV
118
      this.networkSession = networkSession;
×
UNCOV
119
      return this;
×
120
    }
121

122
    public RecentItemsManager build() {
NEW
123
      if (this.networkSession == null) {
×
NEW
124
        this.networkSession = new NetworkSession();
×
125
      }
126
      return new RecentItemsManager(this);
×
127
    }
128
  }
129
}
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