use of wooteco.prolog.report.application.dto.ReportResponse in project prolog by woowacourse.
the class ReportStepDefinitions method 리포트가조회된다.
@Then("리포트가 조회된다")
public void 리포트가조회된다() {
ReportResponse reportResponse = context.response.as(ReportResponse.class);
assertThat(reportResponse.getId()).isNotNull();
}
use of wooteco.prolog.report.application.dto.ReportResponse in project prolog by woowacourse.
the class ReportStepDefinitions method 리포트를수정하면.
@When("리포트를 수정하면")
public void 리포트를수정하면() {
ReportResponse report = (ReportResponse) context.storage.get("report");
ReportUpdateRequest reportUpdateRequest = new ReportUpdateRequest("변경된 리포트", "변경된 리포트 설명1");
context.storage.put("reportRequest", reportUpdateRequest);
context.invokeHttpPutWithToken("/reports/" + report.getId(), reportUpdateRequest);
}
use of wooteco.prolog.report.application.dto.ReportResponse in project prolog by woowacourse.
the class ReportStepDefinitions method 리포트목록에서제거된다.
@Then("리포트 목록에서 제거된다")
public void 리포트목록에서제거된다() {
String username = (String) context.storage.get("username");
context.invokeHttpGetWithToken("/members/" + username + "/reports");
assertThat(context.response.statusCode()).isEqualTo(HttpStatus.OK.value());
ReportResponse report = (ReportResponse) context.storage.get("report");
List<Long> reportIds = context.response.jsonPath().getList("id");
assertThat(reportIds).isNull();
}
use of wooteco.prolog.report.application.dto.ReportResponse in project prolog by woowacourse.
the class ReportStepDefinitions method 리포트를삭제하면.
@When("리포트를 삭제하면")
public void 리포트를삭제하면() {
ReportResponse report = (ReportResponse) context.storage.get("report");
context.invokeHttpDeleteWithToken("/reports/" + report.getId());
}
use of wooteco.prolog.report.application.dto.ReportResponse in project prolog by woowacourse.
the class ReportService method findReportsByUsername.
public PageableResponse<ReportResponse> findReportsByUsername(String username, Pageable pageable) {
Member member = memberService.findByUsername(username);
Page<Report> reports = reportRepository.findByMemberId(member.getId(), pageable);
List<ReportResponse> reportResponses = ReportResponse.listOf(reports);
return PageableResponse.of(reportResponses, reports);
}
Aggregations