Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@Schema(description = "Paginated list of job applications")
public record ApplicationPageResponse(
@Schema(description = "Applications on this page")
List<ApplicationResponse> content,
List<ApplicationResponse> applications,
@Schema(description = "Current page number (0-based)", example = "0")
int pageNumber,
@Schema(description = "Number of items per page", example = "10")
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/com/jobtracker/e2e/ApplicationE2ETest.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ void fullApplicationCrud_createFetchUpdateArchiveAndHardDelete() {
.get("/api/v1/applications")
.then()
.statusCode(200)
.body("content", hasSize(1))
.body("applications", hasSize(1))
.body("totalElements", equalTo(1));

// 7. Archive
Expand Down Expand Up @@ -231,7 +231,7 @@ void getAll_withFilter_shouldReturnFilteredResults() {
.then()
.statusCode(200)
.body("totalElements", equalTo(1))
.body("content[0].vacancyName", equalTo("App RH"));
.body("applications[0].vacancyName", equalTo("App RH"));

// Filter by interviewScheduled
given()
Expand All @@ -241,7 +241,7 @@ void getAll_withFilter_shouldReturnFilteredResults() {
.then()
.statusCode(200)
.body("totalElements", equalTo(1))
.body("content[0].vacancyName", equalTo("App Tecnico"));
.body("applications[0].vacancyName", equalTo("App Tecnico"));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ void getAll_shouldReturnPagedResponse() throws Exception {
mockMvc.perform(get("/api/v1/applications")
.header("Authorization", "Bearer " + accessToken))
.andExpect(status().isOk())
.andExpect(jsonPath("$.content").isArray())
.andExpect(jsonPath("$.applications").isArray())
.andExpect(jsonPath("$.totalElements").value(2));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void getAll_shouldReturnPagedResponse() {
when(applicationMapper.toResponse(app)).thenReturn(response);

ApplicationPageResponse result = applicationService.getAll(null, null, null, null, null, null, false, 0, 10, null);
assertThat(result.content()).hasSize(1);
assertThat(result.applications()).hasSize(1);
assertThat(result.totalElements()).isEqualTo(1);
}

Expand Down
Loading