Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jobdri.jobdri_api.domain.analysis.dto.response;

public record QuestionCandidateResponse(
Long questionId,
String content,
int charLimit,
boolean selected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ public class QuestionService {
private static final int DEFAULT_CHAR_LIMIT = 1000;

private static final List<QuestionCandidate> DEFAULT_CANDIDATES = List.of(
new QuestionCandidate("지원 동기와 입사 후 목표를 작성해주세요.", 700),
new QuestionCandidate("지원 직무와 관련된 경험 또는 역량을 구체적으로 작성해주세요.", 1000),
new QuestionCandidate("문제를 해결했던 경험과 그 과정에서의 역할을 작성해주세요.", 1000),
new QuestionCandidate("협업 과정에서 갈등을 해결했던 경험을 작성해주세요.", 800),
new QuestionCandidate("가장 성취감을 느꼈던 프로젝트와 성과를 작성해주세요.", 1000)
new QuestionCandidate(1L, "지원 동기와 입사 후 목표를 작성해주세요.", 700),
new QuestionCandidate(2L, "지원 직무와 관련된 경험 또는 역량을 구체적으로 작성해주세요.", 1000),
new QuestionCandidate(3L, "문제를 해결했던 경험과 그 과정에서의 역할을 작성해주세요.", 1000),
new QuestionCandidate(4L, "협업 과정에서 갈등을 해결했던 경험을 작성해주세요.", 800),
new QuestionCandidate(5L, "가장 성취감을 느꼈던 프로젝트와 성과를 작성해주세요.", 1000)
);

private final MockApplyRepository mockApplyRepository;
Expand All @@ -53,6 +53,7 @@ public List<QuestionCandidateResponse> getQuestionCandidates(User user, Long moc

return DEFAULT_CANDIDATES.stream()
.map(candidate -> new QuestionCandidateResponse(
candidate.id(),
candidate.content(),
candidate.charLimit(),
selectedContents.contains(candidate.content())
Expand Down Expand Up @@ -165,6 +166,6 @@ private String normalizeAnswer(String answer) {
return "";
}

private record QuestionCandidate(String content, int charLimit) {
private record QuestionCandidate(Long id, String content, int charLimit) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ void getQuestionCandidatesMarksSelectedQuestion() {
List<QuestionCandidateResponse> candidates = questionService.getQuestionCandidates(user, mockApply.getId());

assertThat(candidates).hasSize(5);
assertThat(candidates)
.extracting(QuestionCandidateResponse::questionId)
.containsExactly(1L, 2L, 3L, 4L, 5L);
assertThat(candidates.get(0).selected()).isTrue();
assertThat(candidates.get(1).selected()).isFalse();
}
Expand Down
Loading