Skip to content

Commit

Permalink
test: 주석 및 메서드 네이밍 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
eom-tae-in committed Jun 14, 2024
1 parent 12e4272 commit f1d8169
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
13 changes: 6 additions & 7 deletions src/test/java/com/atwoz/report/domain/vo/ReportResultTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.junit.jupiter.api.Test;

import static com.atwoz.report.domain.vo.ReportResult.BAN;
import static com.atwoz.report.domain.vo.ReportResult.findByName;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

Expand All @@ -19,12 +18,12 @@ class ReportResultTest {
class ReportResult_조회 {

@Test
void 신고_결과_정보가_유효하지_않으면_예외가_밠생한다() {
// given
void 신고_결과_정보가_유효하지_않으면_예외가_발생한다() {
// given
String invalidReportResult = "invalid report result";

// when
assertThatThrownBy(() -> findByName(invalidReportResult))
// when & then
assertThatThrownBy(() -> ReportResult.findByName(invalidReportResult))
.isInstanceOf(InvalidReportResultException.class);
}

Expand All @@ -33,8 +32,8 @@ class ReportResult_조회 {
// given
String validReportResult = BAN.getName();

// When
ReportResult foundReportResult = findByName(validReportResult);
// when
ReportResult foundReportResult = ReportResult.findByName(validReportResult);

// then
assertThat(foundReportResult.getName()).isEqualTo(validReportResult);
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/com/atwoz/report/domain/vo/ReportTypeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class ReportTypeTest {
class ReportType_조회{

@Test
void 신고_유형_정보가_유효하지_않으면_예외가_밠생한다() {
// given
void 신고_유형_정보가_유효하지_않으면_예외가_발생한다() {
// given
String invalidReportType = "invalid report type";

// when
// when & then
assertThatThrownBy(() -> ReportType.findByCode(invalidReportType))
.isInstanceOf(InvalidReportTypeException.class);
}
Expand All @@ -32,7 +32,7 @@ class ReportType_조회{
// given
String validReportType = FAKE_PROFILE.getCode();

// When
// when
ReportType foundReportType = ReportType.findByCode(validReportType);

// then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ class ReportJpaRepositoryTest {
assertSoftly(softly -> {
softly.assertThat(foundReport).isPresent();
Report report = foundReport.get();
softly.assertThat(report).usingRecursiveComparison().isEqualTo(createdReport);
softly.assertThat(report)
.usingRecursiveComparison()
.isEqualTo(createdReport);
});
}
}

0 comments on commit f1d8169

Please sign in to comment.