use of wooteco.prolog.report.application.dto.report.response.ReportPageableResponse in project prolog by woowacourse.
the class ReportStepDefinitions method 리포트목록이조회된다.
@Then("리포트")
@Then("리포트 목록이 조회된다")
public void 리포트목록이조회된다() {
ReportPageableResponse reportPageableResponse = context.response.as(ReportPageableResponse.class);
assertThat(reportPageableResponse.getCurrentPage()).isOne();
assertThat(reportPageableResponse.getTotalPage()).isOne();
assertThat(reportPageableResponse.getTotalSize()).isOne();
assertThat(reportPageableResponse.getReports()).hasSize(1);
}
use of wooteco.prolog.report.application.dto.report.response.ReportPageableResponse in project prolog by woowacourse.
the class ReportStepDefinitions method 대표리포트생성날짜순으로정렬되어반환된다.
@Then("대표리포트, 생성날짜 순으로 정렬되어 반환된다")
public void 대표리포트생성날짜순으로정렬되어반환된다() {
ReportPageableResponse pageableResponse = context.response.as(new TypeRef<ReportPageableResponse>() {
});
List<ReportResponse> response = pageableResponse.getReports();
List<Long> ids = response.stream().map(ReportResponse::getId).collect(toList());
List<Long> expected = response.stream().sorted(comparing(ReportResponse::isRepresent).thenComparing(ReportResponse::getCreatedAt).reversed()).map(ReportResponse::getId).collect(toList());
assertThat(ids).containsExactlyElementsOf(expected);
}
Aggregations