fixed failing searchControllerTests

This commit is contained in:
2026-07-01 18:16:11 +02:00
parent e310c1bbd8
commit fed981212a
2 changed files with 7 additions and 8 deletions
@@ -63,7 +63,7 @@ public class HomeboxSearchProvider implements SearchProvider {
String id = i.id(); String id = i.id();
String title = i.name(); String title = i.name();
String description = i.description(); String description = i.description();
Map<String, Object> extraSearchResponseData = Map.of("extraData", i.parent()); Map<String, Object> extraSearchResponseData = Map.of("parent", i.parent());
return new ServiceItem(id, title, description, extraSearchResponseData); return new ServiceItem(id, title, description, extraSearchResponseData);
}).toList(); }).toList();
@@ -63,11 +63,11 @@ class SearchControllerTest {
"description": "Weißer Ikea Schrank, wo sich der Server befindet.", "description": "Weißer Ikea Schrank, wo sich der Server befindet.",
"createdAt": "2026-05-13T19:55:55.817576Z", "createdAt": "2026-05-13T19:55:55.817576Z",
"updatedAt": "2026-05-14T12:37:24.396651Z" "updatedAt": "2026-05-14T12:37:24.396651Z"
}, },
"tags": [], "tags": [],
"imageId": "cb3e44d5-ccd4-421e-9f5a-f52cd5f40ca6", "imageId": "cb3e44d5-ccd4-421e-9f5a-f52cd5f40ca6",
"thumbnailId": "2bfd53fa-1bf1-483c-8d76-7720464532fa", "thumbnailId": "2bfd53fa-1bf1-483c-8d76-7720464532fa",
"soldTime": "0001-01-01T00:00:00Z" "soldTime": "0001-01-01T00:00:00Z"
} }
] ]
} }
@@ -93,8 +93,7 @@ class SearchControllerTest {
.andExpect(status().isOk()) .andExpect(status().isOk())
.andExpect(jsonPath("$.content[0].title").value("MacBook Pro A1398")) .andExpect(jsonPath("$.content[0].title").value("MacBook Pro A1398"))
.andExpect(jsonPath("$.totalElements").value(1)) .andExpect(jsonPath("$.totalElements").value(1))
.andExpect(jsonPath("$.content[0].extraData.location.name") .andExpect(jsonPath("$.content[0].extraData.parent.name").value("Server Schrank Ikea weiß"));
.value("Server Schrank Ikea weiß"));
} }
@Test @Test