Compare commits

..

1 commit

Author SHA1 Message Date
1e8c15d52f TD-34: Endpoint for getting all players and tests
All checks were successful
Quality Check / Validate OAS (push) Successful in 37s
Quality Check / Validate OAS (pull_request) Successful in 38s
Quality Check / Testing (push) Successful in 1m17s
Quality Check / Static Analysis (push) Successful in 1m24s
Quality Check / Linting (push) Successful in 1m49s
Quality Check / Linting (pull_request) Successful in 1m17s
Quality Check / Static Analysis (pull_request) Successful in 1m16s
Quality Check / Testing (pull_request) Successful in 51s
2025-03-05 08:53:54 +01:00
3 changed files with 6 additions and 6 deletions

View file

@ -66,7 +66,7 @@ public class AdminApiController implements AdminApi {
String sortBy = body.getSortBy();
String username = body.getUsername();
Sort.Direction direction = orderToDirectionMapperService.OrderToDirection(order);
Sort.Direction direction = orderToDirectionMapperService.orderToDirection(order);
Pageable pageable = PageRequest.of(page, pageSize, Sort.by(direction, sortBy));

View file

@ -7,7 +7,7 @@ import org.springframework.stereotype.Component;
@Component
public class OrderToDirectionMapperService {
public Sort.Direction OrderToDirection(PlayerFilter.OrderEnum order) {
public Sort.Direction orderToDirection(PlayerFilter.OrderEnum order) {
if (order == PlayerFilter.OrderEnum.ASCENDING) {
return Sort.Direction.ASC;

View file

@ -47,8 +47,8 @@ class GetAllPlayersTest extends IntegrationTest {
this.mvc.perform(createGetAllPlayersRequest(requestBody))
.andExpect(status().isOk())
.andExpect(jsonPath("$[1].username").value("Alex"))
.andExpect(jsonPath("$[0].username").value("Zorro"));
.andExpect(jsonPath("$[0].username").value("Alex"))
.andExpect(jsonPath("$[1].username").value("Zorro"));
}
@Test
@ -63,8 +63,8 @@ class GetAllPlayersTest extends IntegrationTest {
this.mvc.perform(createGetAllPlayersRequest(requestBody))
.andExpect(status().isOk())
.andExpect(jsonPath("$[0].username").value("Alex"))
.andExpect(jsonPath("$[1].username").value("Zorro"));
.andExpect(jsonPath("$[1].username").value("Alex"))
.andExpect(jsonPath("$[0].username").value("Zorro"));
}
@Test