0
我正在寫Spring Boot REST服務器。Spring Boot Paging not working
這是我TripController.java
@RequestMapping(path = "/", method = RequestMethod.GET)
public GenericResponse<List<Trip>> getUserTrips(@RequestParam("owner") String owner) {
Pageable pageRequest = createPageRequest();
List<Trip> trips = tripRepository.findByOwner(owner , pageRequest);
return new GenericResponse<List<Trip>>(200, "Success", trips);
}
private Pageable createPageRequest()
return new PageRequest(0, 10);
}
在編譯時,測試階段我得到這個錯誤:
org.apache.maven.lifecycle.LifecycleExecutionException:未能執行目標org.apache .maven.plugins:maven-surefire-plugin:2.18.1:項目演示測試(默認測試):測試失敗。
完整的錯誤報告是在這裏:https://pastebin.com/s4u5RX51