Search in sources :

Example 1 with SessionRequest

use of wooteco.prolog.session.application.dto.SessionRequest in project prolog by woowacourse.

the class StudylogTagServiceTest method setUp.

@BeforeEach
void setUp() {
    SessionResponse session = sessionService.create(new SessionRequest("세션1"));
    MissionResponse mission = missionService.create(new MissionRequest("미션 이름", session.getId()));
    this.member = memberService.findOrCreateMember(new GithubProfileResponse("이름", "별명", "1", "image"));
}
Also used : MissionRequest(wooteco.prolog.session.application.dto.MissionRequest) GithubProfileResponse(wooteco.prolog.login.application.dto.GithubProfileResponse) MissionResponse(wooteco.prolog.session.application.dto.MissionResponse) SessionResponse(wooteco.prolog.session.application.dto.SessionResponse) SessionRequest(wooteco.prolog.session.application.dto.SessionRequest) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with SessionRequest

use of wooteco.prolog.session.application.dto.SessionRequest in project prolog by woowacourse.

the class StudylogTagServiceTest method setUp.

@BeforeEach
void setUp() {
    SessionResponse session = sessionService.create(new SessionRequest("세션1"));
    MissionResponse mission = missionService.create(new MissionRequest("미션 이름", session.getId()));
    this.member = memberService.findOrCreateMember(new GithubProfileResponse("이름", "별명", "1", "image"));
}
Also used : MissionRequest(wooteco.prolog.session.application.dto.MissionRequest) GithubProfileResponse(wooteco.prolog.login.application.dto.GithubProfileResponse) MissionResponse(wooteco.prolog.session.application.dto.MissionResponse) SessionResponse(wooteco.prolog.session.application.dto.SessionResponse) SessionRequest(wooteco.prolog.session.application.dto.SessionRequest) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with SessionRequest

use of wooteco.prolog.session.application.dto.SessionRequest in project prolog by woowacourse.

the class TagDocumentation method 태그_목록을_조회한다.

@Test
void 태그_목록을_조회한다() {
    // given
    String title = "SPA";
    String content = "SPA 방식으로 앱을 구현하였음.\n" + "router 를 구현 하여 이용함.\n";
    Long sessionId = 세션_등록함(new SessionRequest("세션1"));
    Long missionId = 미션_등록함(new MissionRequest("세션1 - 지하철 노선도 미션", sessionId));
    List<TagRequest> tags = Arrays.asList(new TagRequest("자바"), new TagRequest("파이썬"));
    StudylogRequest studylogRequest = new StudylogRequest(title, content, missionId, tags);
    List<StudylogRequest> params = Arrays.asList(studylogRequest);
    RestAssured.given().header("Authorization", "Bearer " + 로그인_사용자.getAccessToken()).body(params).contentType(MediaType.APPLICATION_JSON_VALUE).when().post("/posts").then().log().all();
    // when
    ExtractableResponse<Response> response = given("tag/list").when().get("/tags").then().log().all().extract();
    // then
    List<TagResponse> tagResponses = response.jsonPath().getList(".", TagResponse.class);
    List<String> tagNames = tagResponses.stream().map(TagResponse::getName).collect(Collectors.toList());
    List<String> expectedNames = tags.stream().map(TagRequest::getName).collect(Collectors.toList());
    assertThat(tagNames).usingRecursiveComparison().isEqualTo(expectedNames);
}
Also used : TagResponse(wooteco.prolog.studylog.application.dto.TagResponse) SessionRequest(wooteco.prolog.session.application.dto.SessionRequest) MissionResponse(wooteco.prolog.session.application.dto.MissionResponse) SessionResponse(wooteco.prolog.session.application.dto.SessionResponse) TagResponse(wooteco.prolog.studylog.application.dto.TagResponse) ExtractableResponse(io.restassured.response.ExtractableResponse) Response(io.restassured.response.Response) MissionRequest(wooteco.prolog.session.application.dto.MissionRequest) TagRequest(wooteco.prolog.studylog.application.dto.TagRequest) StudylogRequest(wooteco.prolog.studylog.application.dto.StudylogRequest) Test(org.junit.jupiter.api.Test)

Example 4 with SessionRequest

use of wooteco.prolog.session.application.dto.SessionRequest in project prolog by woowacourse.

the class SessionStepDefinitions method 강의여러개를작성하고.

@Given("강의 여러개를 작성하고")
public void 강의여러개를작성하고() {
    context.invokeHttpPost("/sessions", new SessionRequest("새로운강의1"));
    context.invokeHttpPost("/sessions", new SessionRequest("새로운강의2"));
    context.invokeHttpPost("/sessions", new SessionRequest("새로운강의3"));
}
Also used : SessionRequest(wooteco.prolog.session.application.dto.SessionRequest) Given(io.cucumber.java.en.Given)

Example 5 with SessionRequest

use of wooteco.prolog.session.application.dto.SessionRequest in project prolog by woowacourse.

the class MemberDocumentation method createStudylogRequest.

private List<StudylogRequest> createStudylogRequest(int size) {
    List<StudylogRequest> studylogRequests = new ArrayList<>();
    for (int i = 0; i < size; i++) {
        String title = "뭐라도 스터디로그가 있어야하니까";
        String content = "SPA 방식으로 앱을 구현하였음.\n" + "router 를 구현 하여 이용함.\n";
        Long sessionId = 세션_등록함(new SessionRequest("세션" + i));
        Long missionId = 미션_등록함(new MissionRequest(String.format("세션%d 미션", i), sessionId));
        List<TagRequest> tags = Arrays.asList(new TagRequest(String.format("%d번 태그", i)));
        studylogRequests.add(new StudylogRequest(title, content, missionId, tags));
    }
    return studylogRequests;
}
Also used : MissionRequest(wooteco.prolog.session.application.dto.MissionRequest) TagRequest(wooteco.prolog.studylog.application.dto.TagRequest) ArrayList(java.util.ArrayList) StudylogRequest(wooteco.prolog.studylog.application.dto.StudylogRequest) SessionRequest(wooteco.prolog.session.application.dto.SessionRequest)

Aggregations

SessionRequest (wooteco.prolog.session.application.dto.SessionRequest)16 MissionRequest (wooteco.prolog.session.application.dto.MissionRequest)13 StudylogRequest (wooteco.prolog.studylog.application.dto.StudylogRequest)9 TagRequest (wooteco.prolog.studylog.application.dto.TagRequest)9 SessionResponse (wooteco.prolog.session.application.dto.SessionResponse)7 MissionResponse (wooteco.prolog.session.application.dto.MissionResponse)6 BeforeEach (org.junit.jupiter.api.BeforeEach)5 GithubProfileResponse (wooteco.prolog.login.application.dto.GithubProfileResponse)4 Session (wooteco.prolog.session.domain.Session)3 ExtractableResponse (io.restassured.response.ExtractableResponse)2 Response (io.restassured.response.Response)2 Test (org.junit.jupiter.api.Test)2 LoginMember (wooteco.prolog.login.ui.LoginMember)2 Mission (wooteco.prolog.session.domain.Mission)2 Studylog (wooteco.prolog.studylog.domain.Studylog)2 Given (io.cucumber.java.en.Given)1 When (io.cucumber.java.en.When)1 ArrayList (java.util.ArrayList)1 StudylogResponse (wooteco.prolog.studylog.application.dto.StudylogResponse)1 StudylogsResponse (wooteco.prolog.studylog.application.dto.StudylogsResponse)1