Search in sources :

Example 1 with MissionResponse

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

the class MissionServiceTest method createTest.

@DisplayName("Mission을 생성한다.")
@Test
void createTest() {
    // given
    MissionRequest request = new MissionRequest("세션1 - 자동차 경주 미션", session1.getId());
    // when
    MissionResponse response = missionService.create(request);
    // then
    assertThat(response.getName()).isEqualTo(request.getName());
    assertThat(response.getSession().getId()).isEqualTo(request.getSessionId());
}
Also used : MissionRequest(wooteco.prolog.session.application.dto.MissionRequest) MissionResponse(wooteco.prolog.session.application.dto.MissionResponse) Test(org.junit.jupiter.api.Test) IntegrationTest(wooteco.support.utils.IntegrationTest) DisplayName(org.junit.jupiter.api.DisplayName)

Example 2 with MissionResponse

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

the class MissionServiceTest method findByIdTest.

@DisplayName("ID를 통해서 Mission을 조회한다.")
@Test
void findByIdTest() {
    // given
    MissionRequest request = new MissionRequest("세션1 - 자동차 경주 미션", session1.getId());
    MissionResponse savedMission = missionService.create(request);
    // when
    Mission foundMission = missionService.findById(savedMission.getId());
    // then
    assertThat(foundMission).usingRecursiveComparison().isEqualTo(savedMission);
}
Also used : MissionRequest(wooteco.prolog.session.application.dto.MissionRequest) MissionResponse(wooteco.prolog.session.application.dto.MissionResponse) Mission(wooteco.prolog.session.domain.Mission) Test(org.junit.jupiter.api.Test) IntegrationTest(wooteco.support.utils.IntegrationTest) DisplayName(org.junit.jupiter.api.DisplayName)

Example 3 with MissionResponse

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

the class MissionServiceTest method findAllTest.

@DisplayName("모든 MissionResponse를 조회한다.")
@Test
void findAllTest() {
    // given
    MissionResponse mission1 = missionService.create(new MissionRequest("세션1 - 자동차 경주 미션", session1.getId()));
    MissionResponse mission2 = missionService.create(new MissionRequest("세션2 - 로또 미션", session2.getId()));
    MissionResponse mission3 = missionService.create(new MissionRequest("세션3 - 블랙잭 미션", session3.getId()));
    // when
    List<MissionResponse> responses = missionService.findAll();
    // then
    assertThat(responses.size()).isEqualTo(3);
}
Also used : MissionRequest(wooteco.prolog.session.application.dto.MissionRequest) MissionResponse(wooteco.prolog.session.application.dto.MissionResponse) Test(org.junit.jupiter.api.Test) IntegrationTest(wooteco.support.utils.IntegrationTest) DisplayName(org.junit.jupiter.api.DisplayName)

Example 4 with MissionResponse

use of wooteco.prolog.session.application.dto.MissionResponse 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 5 with MissionResponse

use of wooteco.prolog.session.application.dto.MissionResponse 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)

Aggregations

MissionRequest (wooteco.prolog.session.application.dto.MissionRequest)10 MissionResponse (wooteco.prolog.session.application.dto.MissionResponse)10 Test (org.junit.jupiter.api.Test)6 SessionResponse (wooteco.prolog.session.application.dto.SessionResponse)6 BeforeEach (org.junit.jupiter.api.BeforeEach)4 DisplayName (org.junit.jupiter.api.DisplayName)4 GithubProfileResponse (wooteco.prolog.login.application.dto.GithubProfileResponse)4 SessionRequest (wooteco.prolog.session.application.dto.SessionRequest)4 Mission (wooteco.prolog.session.domain.Mission)4 IntegrationTest (wooteco.support.utils.IntegrationTest)4 ExtractableResponse (io.restassured.response.ExtractableResponse)2 Response (io.restassured.response.Response)2 LoginMember (wooteco.prolog.login.ui.LoginMember)2 Session (wooteco.prolog.session.domain.Session)2 Studylog (wooteco.prolog.studylog.domain.Studylog)2