Skip to content

Commit e3216d2

Browse files
fix: replace Lombok on ToolExecutionMetric and add missing acceptedPrivacyPolicy in E2E tests
ToolExecutionMetric was using Lombok annotations (@Getter, @Setter, @builder) which fail annotation processing under GraalVM/Java 25. Replaced with manual getters, setters, and a static inner Builder following the existing codebase style. E2E register payloads were missing the acceptedPrivacyPolicy field introduced in a recent migration, causing all registration calls to return 400. Added acceptedPrivacyPolicy: true to all affected test payloads in ApplicationE2ETest and AuthE2ETest. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 37d80d6 commit e3216d2

3 files changed

Lines changed: 84 additions & 14 deletions

File tree

src/main/java/com/jobtracker/entity/ToolExecutionMetric.java

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.jobtracker.entity;
22

33
import jakarta.persistence.*;
4-
import lombok.*;
54
import org.hibernate.annotations.UuidGenerator;
65

76
import java.time.LocalDateTime;
@@ -13,11 +12,6 @@
1312
@Index(name = "idx_tool_metrics_created_at", columnList = "created_at"),
1413
@Index(name = "idx_tool_metrics_expensive", columnList = "expensive")
1514
})
16-
@Getter
17-
@Setter
18-
@Builder
19-
@NoArgsConstructor
20-
@AllArgsConstructor
2115
public class ToolExecutionMetric {
2216

2317
@Id
@@ -58,4 +52,72 @@ protected void onCreate() {
5852
createdAt = LocalDateTime.now();
5953
}
6054
}
55+
56+
public UUID getId() { return id; }
57+
public void setId(UUID id) { this.id = id; }
58+
59+
public String getToolName() { return toolName; }
60+
public void setToolName(String toolName) { this.toolName = toolName; }
61+
62+
public long getExecutionTimeMs() { return executionTimeMs; }
63+
public void setExecutionTimeMs(long executionTimeMs) { this.executionTimeMs = executionTimeMs; }
64+
65+
public int getRequestBytes() { return requestBytes; }
66+
public void setRequestBytes(int requestBytes) { this.requestBytes = requestBytes; }
67+
68+
public int getResponseBytes() { return responseBytes; }
69+
public void setResponseBytes(int responseBytes) { this.responseBytes = responseBytes; }
70+
71+
public int getRequestTokens() { return requestTokens; }
72+
public void setRequestTokens(int requestTokens) { this.requestTokens = requestTokens; }
73+
74+
public int getResponseTokens() { return responseTokens; }
75+
public void setResponseTokens(int responseTokens) { this.responseTokens = responseTokens; }
76+
77+
public int getTotalTokens() { return totalTokens; }
78+
public void setTotalTokens(int totalTokens) { this.totalTokens = totalTokens; }
79+
80+
public boolean isExpensive() { return expensive; }
81+
public void setExpensive(boolean expensive) { this.expensive = expensive; }
82+
83+
public LocalDateTime getCreatedAt() { return createdAt; }
84+
public void setCreatedAt(LocalDateTime createdAt) { this.createdAt = createdAt; }
85+
86+
public static Builder builder() { return new Builder(); }
87+
88+
public static class Builder {
89+
private String toolName;
90+
private long executionTimeMs;
91+
private int requestBytes;
92+
private int responseBytes;
93+
private int requestTokens;
94+
private int responseTokens;
95+
private int totalTokens;
96+
private boolean expensive;
97+
private LocalDateTime createdAt;
98+
99+
public Builder toolName(String toolName) { this.toolName = toolName; return this; }
100+
public Builder executionTimeMs(long executionTimeMs) { this.executionTimeMs = executionTimeMs; return this; }
101+
public Builder requestBytes(int requestBytes) { this.requestBytes = requestBytes; return this; }
102+
public Builder responseBytes(int responseBytes) { this.responseBytes = responseBytes; return this; }
103+
public Builder requestTokens(int requestTokens) { this.requestTokens = requestTokens; return this; }
104+
public Builder responseTokens(int responseTokens) { this.responseTokens = responseTokens; return this; }
105+
public Builder totalTokens(int totalTokens) { this.totalTokens = totalTokens; return this; }
106+
public Builder expensive(boolean expensive) { this.expensive = expensive; return this; }
107+
public Builder createdAt(LocalDateTime createdAt) { this.createdAt = createdAt; return this; }
108+
109+
public ToolExecutionMetric build() {
110+
ToolExecutionMetric m = new ToolExecutionMetric();
111+
m.toolName = toolName;
112+
m.executionTimeMs = executionTimeMs;
113+
m.requestBytes = requestBytes;
114+
m.responseBytes = responseBytes;
115+
m.requestTokens = requestTokens;
116+
m.responseTokens = responseTokens;
117+
m.totalTokens = totalTokens;
118+
m.expensive = expensive;
119+
m.createdAt = createdAt;
120+
return m;
121+
}
122+
}
61123
}

src/test/java/com/jobtracker/e2e/ApplicationE2ETest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ void setUp() {
4747
"name": "App E2E User",
4848
"email": "appe2e@example.com",
4949
"password": "pass1234",
50-
"confirmPassword": "pass1234"
50+
"confirmPassword": "pass1234",
51+
"acceptedPrivacyPolicy": true
5152
}
5253
""")
5354
.post("/api/v1/auth/register")
@@ -282,7 +283,8 @@ void getById_shouldReturn404_whenBelongsToAnotherUser() {
282283
.contentType("application/json")
283284
.body("""
284285
{"name": "Other User", "email": "other@example.com",
285-
"password": "pass1234", "confirmPassword": "pass1234"}
286+
"password": "pass1234", "confirmPassword": "pass1234",
287+
"acceptedPrivacyPolicy": true}
286288
""")
287289
.post("/api/v1/auth/register");
288290

src/test/java/com/jobtracker/e2e/AuthE2ETest.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ void fullAuthFlow_register_login_refresh_logout() {
5757
"name": "E2E User",
5858
"email": "e2e@example.com",
5959
"password": "pass1234",
60-
"confirmPassword": "pass1234"
60+
"confirmPassword": "pass1234",
61+
"acceptedPrivacyPolicy": true
6162
}
6263
""")
6364
.when()
@@ -168,7 +169,8 @@ void register_shouldSetHttpOnlySecureSameSiteCookie() {
168169
"name": "Cookie User",
169170
"email": "cookies@example.com",
170171
"password": "pass1234",
171-
"confirmPassword": "pass1234"
172+
"confirmPassword": "pass1234",
173+
"acceptedPrivacyPolicy": true
172174
}
173175
""")
174176
.when()
@@ -192,7 +194,8 @@ void register_shouldReturn409_whenEmailDuplicated() {
192194
"name": "Dup User",
193195
"email": "dup@example.com",
194196
"password": "pass1234",
195-
"confirmPassword": "pass1234"
197+
"confirmPassword": "pass1234",
198+
"acceptedPrivacyPolicy": true
196199
}
197200
""";
198201

@@ -212,7 +215,8 @@ void register_shouldReturn400_whenPasswordsMismatch() {
212215
"name": "Mismatch User",
213216
"email": "mismatch@example.com",
214217
"password": "pass1234",
215-
"confirmPassword": "different"
218+
"confirmPassword": "different",
219+
"acceptedPrivacyPolicy": true
216220
}
217221
""")
218222
.when()
@@ -231,7 +235,8 @@ void login_shouldReturn401_whenWrongPassword() {
231235
"name": "Wrong Pass",
232236
"email": "wrongpass@example.com",
233237
"password": "pass1234",
234-
"confirmPassword": "pass1234"
238+
"confirmPassword": "pass1234",
239+
"acceptedPrivacyPolicy": true
235240
}
236241
""")
237242
.post("/api/v1/auth/register")
@@ -265,7 +270,8 @@ void logout_shouldReturnSuccess_andClearCookie() {
265270
"name": "Logout User",
266271
"email": "logout@example.com",
267272
"password": "pass1234",
268-
"confirmPassword": "pass1234"
273+
"confirmPassword": "pass1234",
274+
"acceptedPrivacyPolicy": true
269275
}
270276
""")
271277
.when()

0 commit comments

Comments
 (0)