diff --git a/build.gradle b/build.gradle index bf593fb3..0943c572 100644 --- a/build.gradle +++ b/build.gradle @@ -86,6 +86,7 @@ jacocoTestReport { "**/*Mapper*", "**/*ErrorMessage*", "**/*DynamicQuery*", + "**/*BaseTimeEntity*", ] + Qdomains) }) ) diff --git a/src/test/java/com/moabam/api/domain/entity/CertificationTest.java b/src/test/java/com/moabam/api/domain/entity/CertificationTest.java new file mode 100644 index 00000000..1e14bf29 --- /dev/null +++ b/src/test/java/com/moabam/api/domain/entity/CertificationTest.java @@ -0,0 +1,41 @@ +package com.moabam.api.domain.entity; + +import static org.assertj.core.api.Assertions.*; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import com.moabam.api.domain.entity.enums.RoomType; + +class CertificationTest { + + String content = "물 마시기"; + String image = "https://s3.testtest"; + + @DisplayName("Certification 생성 성공") + @Test + void create_certification_success() { + Room room = Room.builder() + .title("앵윤이의 방") + .roomType(RoomType.MORNING) + .certifyTime(10) + .maxUserCount(9) + .build(); + + Routine routine = Routine.builder() + .room(room) + .content(content) + .build(); + + assertThatNoException().isThrownBy(() -> { + Certification certification = Certification.builder() + .routine(routine) + .memberId(1L) + .image(image).build(); + + assertThat(certification.getImage()).isEqualTo(image); + assertThat(certification.getMemberId()).isEqualTo(1L); + assertThat(certification.getRoutine()).isEqualTo(routine); + }); + } +} diff --git a/src/test/java/com/moabam/api/domain/MemberTest.java b/src/test/java/com/moabam/api/domain/entity/MemberTest.java similarity index 96% rename from src/test/java/com/moabam/api/domain/MemberTest.java rename to src/test/java/com/moabam/api/domain/entity/MemberTest.java index 02cfc8d7..dbc695fc 100644 --- a/src/test/java/com/moabam/api/domain/MemberTest.java +++ b/src/test/java/com/moabam/api/domain/entity/MemberTest.java @@ -1,4 +1,4 @@ -package com.moabam.api.domain; +package com.moabam.api.domain.entity; import static org.assertj.core.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*; @@ -6,7 +6,6 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import com.moabam.api.domain.entity.Member; import com.moabam.api.domain.entity.enums.Role; import com.moabam.global.common.util.BaseImageUrl; diff --git a/src/test/java/com/moabam/api/domain/entity/RoomTest.java b/src/test/java/com/moabam/api/domain/entity/RoomTest.java index b9df5be3..d4516b62 100644 --- a/src/test/java/com/moabam/api/domain/entity/RoomTest.java +++ b/src/test/java/com/moabam/api/domain/entity/RoomTest.java @@ -26,6 +26,13 @@ void create_room_without_password_success() { // then assertThat(room.getPassword()).isNull(); + assertThat(room.getRoomImage()).isEqualTo("'temptemp'"); + assertThat(room.getRoomType()).isEqualTo(RoomType.MORNING); + assertThat(room.getCertifyTime()).isEqualTo(10); + assertThat(room.getMaxUserCount()).isEqualTo(9); + assertThat(room.getLevel()).isZero(); + assertThat(room.getCurrentUserCount()).isEqualTo(1); + assertThat(room.getAnnouncement()).isNull(); } @DisplayName("비밀번호 설정 후 방 생성 성공")