【发布时间】:2017-04-21 17:42:27
【问题描述】:
我正在编写 Spring Boot REST 服务器。
这是我的 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: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project demo: 有测试失败。
完整的错误报告在这里:https://pastebin.com/s4u5RX51
【问题讨论】:
标签: java rest spring-boot pagination