• 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

82.05
/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) {
1✔
29
    this.auth = builder.auth;
1✔
30
    this.networkSession = builder.networkSession;
1✔
31
  }
1✔
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());
1✔
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 =
1✔
71
        prepareParams(
1✔
72
            mapOf(
1✔
73
                entryOf("fields", convertToString(queryParams.getFields())),
1✔
74
                entryOf("limit", convertToString(queryParams.getLimit())),
1✔
75
                entryOf("marker", convertToString(queryParams.getMarker()))));
1✔
76
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1✔
77
    FetchResponse response =
1✔
78
        this.networkSession
79
            .getNetworkClient()
1✔
80
            .fetch(
1✔
81
                new FetchOptions.Builder(
82
                        String.join(
1✔
83
                            "",
84
                            this.networkSession.getBaseUrls().getBaseUrl(),
1✔
85
                            "/2.0/recent_items"),
86
                        "GET")
87
                    .params(queryParamsMap)
1✔
88
                    .headers(headersMap)
1✔
89
                    .responseFormat(ResponseFormat.JSON)
1✔
90
                    .auth(this.auth)
1✔
91
                    .networkSession(this.networkSession)
1✔
92
                    .build());
1✔
93
    return JsonManager.deserialize(response.getData(), RecentItems.class);
1✔
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

110
    public Builder() {
1✔
111
      this.networkSession = new NetworkSession();
1✔
112
    }
1✔
113

114
    public Builder auth(Authentication auth) {
115
      this.auth = auth;
1✔
116
      return this;
1✔
117
    }
118

119
    public Builder networkSession(NetworkSession networkSession) {
120
      this.networkSession = networkSession;
1✔
121
      return this;
1✔
122
    }
123

124
    public RecentItemsManager build() {
125
      return new RecentItemsManager(this);
1✔
126
    }
127
  }
128
}
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