Compare commits
1 commit
35b538c7ef
...
1e8c15d52f
Author | SHA1 | Date | |
---|---|---|---|
1e8c15d52f |
3 changed files with 6 additions and 6 deletions
|
@ -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));
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue