• 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

8.22
/src/main/java/com/box/sdkgen/schemas/event/Event.java
1
package com.box.sdkgen.schemas.event;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.internal.utils.DateTimeUtils;
6
import com.box.sdkgen.schemas.appitemeventsource.AppItemEventSource;
7
import com.box.sdkgen.schemas.eventsource.EventSource;
8
import com.box.sdkgen.schemas.eventsourceresource.EventSourceResource;
9
import com.box.sdkgen.schemas.file.File;
10
import com.box.sdkgen.schemas.folder.Folder;
11
import com.box.sdkgen.schemas.user.User;
12
import com.box.sdkgen.schemas.usermini.UserMini;
13
import com.box.sdkgen.serialization.json.EnumWrapper;
14
import com.fasterxml.jackson.annotation.JsonFilter;
15
import com.fasterxml.jackson.annotation.JsonProperty;
16
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
17
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
18
import java.time.OffsetDateTime;
19
import java.util.Map;
20
import java.util.Objects;
21

22
/** The description of an event that happened within Box. */
23
@JsonFilter("nullablePropertyFilter")
24
public class Event extends SerializableObject {
25

26
  /** The value will always be `event`. */
27
  protected String type;
28

29
  /** When the event object was created. */
30
  @JsonProperty("created_at")
31
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
32
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
33
  protected OffsetDateTime createdAt;
34

35
  /** When the event object was recorded in database. */
36
  @JsonProperty("recorded_at")
37
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
38
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
39
  protected OffsetDateTime recordedAt;
40

41
  /** The ID of the event object. You can use this to detect duplicate events. */
42
  @JsonProperty("event_id")
43
  protected String eventId;
44

45
  @JsonProperty("created_by")
46
  protected UserMini createdBy;
47

48
  @JsonDeserialize(using = EventEventTypeField.EventEventTypeFieldDeserializer.class)
49
  @JsonSerialize(using = EventEventTypeField.EventEventTypeFieldSerializer.class)
50
  @JsonProperty("event_type")
51
  protected EnumWrapper<EventEventTypeField> eventType;
52

53
  /**
54
   * The session of the user that performed the action. Not all events will populate this attribute.
55
   */
56
  @JsonProperty("session_id")
57
  protected String sessionId;
58

59
  protected EventSourceResource source;
60

61
  /**
62
   * This object provides additional information about the event if available.
63
   *
64
   * <p>This can include how a user performed an event as well as additional information to
65
   * correlate an event to external KeySafe logs. Not all events have an `additional_details`
66
   * object. This object is only available in the Enterprise Events.
67
   */
68
  @JsonProperty("additional_details")
69
  protected Map<String, Object> additionalDetails;
70

71
  public Event() {
72
    super();
1✔
73
  }
1✔
74

75
  protected Event(Builder builder) {
76
    super();
×
77
    this.type = builder.type;
×
78
    this.createdAt = builder.createdAt;
×
79
    this.recordedAt = builder.recordedAt;
×
80
    this.eventId = builder.eventId;
×
81
    this.createdBy = builder.createdBy;
×
82
    this.eventType = builder.eventType;
×
83
    this.sessionId = builder.sessionId;
×
84
    this.source = builder.source;
×
85
    this.additionalDetails = builder.additionalDetails;
×
86
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
87
  }
×
88

89
  public String getType() {
90
    return type;
×
91
  }
92

93
  public OffsetDateTime getCreatedAt() {
94
    return createdAt;
×
95
  }
96

97
  public OffsetDateTime getRecordedAt() {
98
    return recordedAt;
×
99
  }
100

101
  public String getEventId() {
102
    return eventId;
×
103
  }
104

105
  public UserMini getCreatedBy() {
106
    return createdBy;
1✔
107
  }
108

109
  public EnumWrapper<EventEventTypeField> getEventType() {
110
    return eventType;
1✔
111
  }
112

113
  public String getSessionId() {
114
    return sessionId;
×
115
  }
116

117
  public EventSourceResource getSource() {
118
    return source;
1✔
119
  }
120

121
  public Map<String, Object> getAdditionalDetails() {
122
    return additionalDetails;
1✔
123
  }
124

125
  @Override
126
  public boolean equals(Object o) {
127
    if (this == o) {
×
128
      return true;
×
129
    }
130
    if (o == null || getClass() != o.getClass()) {
×
131
      return false;
×
132
    }
133
    Event casted = (Event) o;
×
134
    return Objects.equals(type, casted.type)
×
135
        && Objects.equals(createdAt, casted.createdAt)
×
136
        && Objects.equals(recordedAt, casted.recordedAt)
×
137
        && Objects.equals(eventId, casted.eventId)
×
138
        && Objects.equals(createdBy, casted.createdBy)
×
139
        && Objects.equals(eventType, casted.eventType)
×
140
        && Objects.equals(sessionId, casted.sessionId)
×
141
        && Objects.equals(source, casted.source)
×
142
        && Objects.equals(additionalDetails, casted.additionalDetails);
×
143
  }
144

145
  @Override
146
  public int hashCode() {
147
    return Objects.hash(
×
148
        type,
149
        createdAt,
150
        recordedAt,
151
        eventId,
152
        createdBy,
153
        eventType,
154
        sessionId,
155
        source,
156
        additionalDetails);
157
  }
158

159
  @Override
160
  public String toString() {
161
    return "Event{"
×
162
        + "type='"
163
        + type
164
        + '\''
165
        + ", "
166
        + "createdAt='"
167
        + createdAt
168
        + '\''
169
        + ", "
170
        + "recordedAt='"
171
        + recordedAt
172
        + '\''
173
        + ", "
174
        + "eventId='"
175
        + eventId
176
        + '\''
177
        + ", "
178
        + "createdBy='"
179
        + createdBy
180
        + '\''
181
        + ", "
182
        + "eventType='"
183
        + eventType
184
        + '\''
185
        + ", "
186
        + "sessionId='"
187
        + sessionId
188
        + '\''
189
        + ", "
190
        + "source='"
191
        + source
192
        + '\''
193
        + ", "
194
        + "additionalDetails='"
195
        + additionalDetails
196
        + '\''
197
        + "}";
198
  }
199

200
  public static class Builder extends NullableFieldTracker {
×
201

202
    protected String type;
203

204
    protected OffsetDateTime createdAt;
205

206
    protected OffsetDateTime recordedAt;
207

208
    protected String eventId;
209

210
    protected UserMini createdBy;
211

212
    protected EnumWrapper<EventEventTypeField> eventType;
213

214
    protected String sessionId;
215

216
    protected EventSourceResource source;
217

218
    protected Map<String, Object> additionalDetails;
219

220
    public Builder type(String type) {
221
      this.type = type;
×
222
      return this;
×
223
    }
224

225
    public Builder createdAt(OffsetDateTime createdAt) {
226
      this.createdAt = createdAt;
×
227
      return this;
×
228
    }
229

230
    public Builder recordedAt(OffsetDateTime recordedAt) {
231
      this.recordedAt = recordedAt;
×
232
      return this;
×
233
    }
234

235
    public Builder eventId(String eventId) {
236
      this.eventId = eventId;
×
237
      return this;
×
238
    }
239

240
    public Builder createdBy(UserMini createdBy) {
241
      this.createdBy = createdBy;
×
242
      return this;
×
243
    }
244

245
    public Builder eventType(EventEventTypeField eventType) {
246
      this.eventType = new EnumWrapper<EventEventTypeField>(eventType);
×
247
      return this;
×
248
    }
249

250
    public Builder eventType(EnumWrapper<EventEventTypeField> eventType) {
251
      this.eventType = eventType;
×
252
      return this;
×
253
    }
254

255
    public Builder sessionId(String sessionId) {
256
      this.sessionId = sessionId;
×
257
      return this;
×
258
    }
259

260
    public Builder source(User source) {
261
      this.source = new EventSourceResource(source);
×
262
      return this;
×
263
    }
264

265
    public Builder source(EventSource source) {
266
      this.source = new EventSourceResource(source);
×
267
      return this;
×
268
    }
269

270
    public Builder source(File source) {
271
      this.source = new EventSourceResource(source);
×
272
      return this;
×
273
    }
274

275
    public Builder source(Folder source) {
276
      this.source = new EventSourceResource(source);
×
277
      return this;
×
278
    }
279

280
    public Builder source(Map<String, Object> source) {
281
      this.source = new EventSourceResource(source);
×
282
      return this;
×
283
    }
284

285
    public Builder source(AppItemEventSource source) {
286
      this.source = new EventSourceResource(source);
×
287
      return this;
×
288
    }
289

290
    public Builder source(EventSourceResource source) {
291
      this.source = source;
×
292
      return this;
×
293
    }
294

295
    public Builder additionalDetails(Map<String, Object> additionalDetails) {
296
      this.additionalDetails = additionalDetails;
×
297
      return this;
×
298
    }
299

300
    public Event build() {
301
      return new Event(this);
×
302
    }
303
  }
304
}
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