Skip to content

Commit

Permalink
Merge pull request #1020 from woowacourse/release/1.5.0
Browse files Browse the repository at this point in the history
Release/1.5.0
  • Loading branch information
gracefulBrown authored Sep 7, 2022
2 parents a908990 + a897f54 commit bbc2d1e
Show file tree
Hide file tree
Showing 235 changed files with 8,104 additions and 2,051 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package wooteco.prolog.fixtures;

import wooteco.prolog.studylog.application.dto.CommentChangeRequest;
import wooteco.prolog.studylog.application.dto.CommentCreateRequest;

public enum CommentAcceptanceFixture {

COMMENT("스터디로그의 댓글 내용입니다."),
UPDATED_COMMENT("수정된 스터디로그의 댓글 내용입니다.");

private final String content;

CommentAcceptanceFixture(String content) {
this.content = content;
}

public CommentCreateRequest getCreateRequest() {
return new CommentCreateRequest(COMMENT.content);
}

public CommentChangeRequest getUpdateRequest() {
return new CommentChangeRequest(UPDATED_COMMENT.content);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package wooteco.prolog.fixtures;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import wooteco.prolog.levellogs.application.dto.LevelLogRequest;
import wooteco.prolog.levellogs.application.dto.SelfDiscussionRequest;

public class LevellogFixture {

public static final List<SelfDiscussionRequest> SELF_DISCUSSION_REQUESTS = Arrays.asList(
new SelfDiscussionRequest("Q1", "A1"),
new SelfDiscussionRequest("Q2", "A2"));

public static final LevelLogRequest LEVEL_LOG_REQUEST = new LevelLogRequest("title1",
"content1",
SELF_DISCUSSION_REQUESTS);

public static final List<SelfDiscussionRequest> SELF_DISCUSSION_UPDATE_REQUESTS = Arrays.asList(
new SelfDiscussionRequest("Updated Q1", "Updated A1"),
new SelfDiscussionRequest("Updated Q2", "Updated A2"));

public static final LevelLogRequest LEVEL_LOG_UPDATE_REQUEST = new LevelLogRequest(
"updated title", "updated content", SELF_DISCUSSION_UPDATE_REQUESTS
);

public static List<LevelLogRequest> levelLogRequests() {
List<LevelLogRequest> requests = new ArrayList<>();
for (int i = 0; i < 5; i++) {
requests.add(
new LevelLogRequest("title" + i, "content" + i, selfDiscussionRequests(3)));
}
return requests;
}

private static List<SelfDiscussionRequest> selfDiscussionRequests(int count) {
List<SelfDiscussionRequest> requests = new ArrayList<>();
for (int i = 0; i < count; i++) {
requests.add(new SelfDiscussionRequest("Q" + i, "A" + i));
}
return requests;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ public enum PostAcceptanceFixture {
2L,
TAG5,
TAG6
),
POST6(
"새로운 스터디로그",
"옵셔널은 NPE를 배제하기 위해 만들어진 자바8에 추가된 라이브러리입니다. \n " +
"다양한 메소드를 호출하여 원하는 대로 활용할 수 있습니다",
1L,
TAG1,
TAG2
);

PostAcceptanceFixture(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

public class SessionAcceptanceFixture {

public static SessionRequest session1 = new SessionRequest("백엔드Java 레벨1 - 2022");
public static SessionRequest session2 = new SessionRequest("프론트엔드JavaScript 레벨1 - 2022");
public static SessionRequest session1 = new SessionRequest("세션1");
public static SessionRequest session2 = new SessionRequest("세션2");
public static SessionRequest session3 = new SessionRequest("세션3");
public static SessionRequest session4 = new SessionRequest("세션4");
public static SessionRequest session5 = new SessionRequest("세션5");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,113 +9,133 @@
import static wooteco.prolog.fixtures.TagAcceptanceFixture.TAG6;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import wooteco.prolog.studylog.application.dto.StudylogRequest;
import wooteco.prolog.studylog.application.dto.TagRequest;

public enum StudylogAcceptanceFixture {
STUDYLOG1(
"[자바][옵셔널] 학습log 제출합니다.",
"옵셔널은 NPE를 배제하기 위해 만들어진 자바8에 추가된 라이브러리입니다. \n " +
"다양한 메소드를 호출하여 원하는 대로 활용할 수 있습니다",
1L,
1L,
TAG1,
TAG2
),
STUDYLOG2(
"[자바스크립트][비동기] 학습log 제출합니다.",
"모던 JS의 fetch문, ajax라이브러리인 axios등을 통해 비동기 요청을 \n " +
"편하게 할 수 있습니다. 자바 최고",
2L,
2L,
TAG3,
TAG4
),
STUDYLOG3(
"[자료구조] 자료구조는 어려워요",
"진짜 어려움",
1L,
1L,
TAG1,
TAG5
),
STUDYLOG4(
"[DOM] DOM DOM Dance",
"덤덤 댄스 아니고",
2L,
2L
),
STUDYLOG5(
"[알고리즘] 자료구조의 big O에 관하여",
"big O는 small O보다 크다",
2L,
2L,
TAG5,
TAG6
),
STUDYLOG6(
"[DOM] DOM DOM Dance",
"덤덤 댄스 아니고",
2L,
null
),
STUDYLOG7(
"[알고리즘] 자료구조의 big O에 관하여",
"big O는 small O보다 크다",
2L,
null,
TAG5,
TAG6
),
STUDYLOG8(
"[공지] 배지에 관하여",
"열정왕을 위해 달려라",
10L,
2L,
TAG5,
TAG6
),
STUDYLOG9(
"[공지] 배지에 관하여2",
"칭찬왕을 위해서 달려라",
11L,
2L,
TAG5,
TAG6
);
STUDYLOG1(
"[자바][옵셔널] 학습log 제출합니다.",
"옵셔널은 NPE를 배제하기 위해 만들어진 자바8에 추가된 라이브러리입니다. \n " +
"다양한 메소드를 호출하여 원하는 대로 활용할 수 있습니다",
1L,
1L,
Collections.emptyList(),
TAG1,
TAG2
),
STUDYLOG2(
"[자바스크립트][비동기] 학습log 제출합니다.",
"모던 JS의 fetch문, ajax라이브러리인 axios등을 통해 비동기 요청을 \n " +
"편하게 할 수 있습니다. 자바 최고",
2L,
2L,
Collections.emptyList(),
TAG3,
TAG4
),
STUDYLOG3(
"[자료구조] 자료구조는 어려워요",
"진짜 어려움",
1L,
1L,
Collections.emptyList(),
TAG1,
TAG5
),
STUDYLOG4(
"[DOM] DOM DOM Dance",
"덤덤 댄스 아니고",
2L,
2L,
Collections.emptyList()
),
STUDYLOG5(
"[알고리즘] 자료구조의 big O에 관하여",
"big O는 small O보다 크다",
2L,
2L,
Collections.emptyList(),
TAG5,
TAG6
),
STUDYLOG6(
"[DOM] DOM DOM Dance",
"덤덤 댄스 아니고",
2L,
null,
Collections.emptyList()
),
STUDYLOG7(
"[알고리즘] 자료구조의 big O에 관하여",
"big O는 small O보다 크다",
2L,
null,
Collections.emptyList(),
TAG5,
TAG6
),
STUDYLOG8(
"[공지] 배지에 관하여",
"열정왕을 위해 달려라",
10L,
2L,
Collections.emptyList(),
TAG5,
TAG6
),
STUDYLOG9(
"[공지] 배지에 관하여2",
"칭찬왕을 위해서 달려라",
11L,
2L,
Collections.emptyList(),
TAG5,
TAG6
),
STUDYLOG10(
"[알고리즘] 알고리즘은 어려워요",
"진짜 어려움",
1L,
1L,
Arrays.asList(4L)
);

private final StudylogRequest studylogRequest;
private final List<TagAcceptanceFixture> tags;
private final StudylogRequest studylogRequest;
private final List<TagAcceptanceFixture> tags;

StudylogAcceptanceFixture(
String title,
String content,
Long sessionId,
Long missionId,
TagAcceptanceFixture... tags) {
this.tags = Arrays.asList(tags);
List<TagRequest> tagRequests = Arrays.stream(tags)
.map(TagAcceptanceFixture::getTagRequest)
.collect(toList());
this.studylogRequest = new StudylogRequest(title, content, sessionId, missionId, tagRequests);
}
StudylogAcceptanceFixture(
String title,
String content,
Long sessionId,
Long missionId,
List<Long> abilities,
TagAcceptanceFixture... tags) {
this.tags = Arrays.asList(tags);
List<TagRequest> tagRequests = Arrays.stream(tags)
.map(TagAcceptanceFixture::getTagRequest)
.collect(toList());
this.studylogRequest = new StudylogRequest(title, content, sessionId, missionId,
tagRequests, abilities
);
}

public static List<StudylogRequest> findByMissionNumber(Long missionId) {
return Arrays.stream(StudylogAcceptanceFixture.values())
.map(StudylogAcceptanceFixture::getStudylogRequest)
.filter(it -> it.getMissionId() != null && it.getMissionId().equals(missionId))
.collect(toList());
}
public static List<StudylogRequest> findByMissionNumber(Long missionId) {
return Arrays.stream(StudylogAcceptanceFixture.values())
.map(StudylogAcceptanceFixture::getStudylogRequest)
.filter(it -> it.getMissionId() != null && it.getMissionId().equals(missionId))
.collect(toList());
}

public static List<StudylogRequest> findByTagNumber(Long tagId) {
return Arrays.stream(StudylogAcceptanceFixture.values())
.filter(it -> it.tags.stream().anyMatch(tag -> tag.getTagId().equals(tagId)))
.map(StudylogAcceptanceFixture::getStudylogRequest)
.collect(toList());
}
public static List<StudylogRequest> findByTagNumber(Long tagId) {
return Arrays.stream(StudylogAcceptanceFixture.values())
.filter(it -> it.tags.stream().anyMatch(tag -> tag.getTagId().equals(tagId)))
.map(StudylogAcceptanceFixture::getStudylogRequest)
.collect(toList());
}

public StudylogRequest getStudylogRequest() {
return studylogRequest;
}
public StudylogRequest getStudylogRequest() {
return studylogRequest;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.springframework.http.HttpStatus;
import wooteco.prolog.AcceptanceSteps;
import wooteco.prolog.common.exception.ExceptionDto;
import wooteco.prolog.studylog.domain.BadgeType;
import wooteco.prolog.badge.domain.BadgeType;

public class BadgesStepDefinitions extends AcceptanceSteps {

Expand Down
Loading

0 comments on commit bbc2d1e

Please sign in to comment.