Skip to content

Commit

Permalink
fix: Mission DomainTest 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
char-yb committed Dec 12, 2023
1 parent 5b56730 commit 40f085d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.depromeet.domain.member.dao;

import com.depromeet.domain.member.domain.Member;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.depromeet.domain.member.domain.Member;

@Repository
public interface MemberRepository extends JpaRepository<Member, Long> {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.depromeet.domain.mission.dao;

import com.depromeet.domain.mission.domain.Mission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.depromeet.domain.mission.domain.Mission;

@Repository
public interface MissionRepository extends JpaRepository<Mission, Long> {}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.depromeet.domain.missionRecord.dao;

import com.depromeet.domain.missionRecord.domain.MissionRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.depromeet.domain.missionRecord.domain.MissionRecord;

@Repository
public interface MissionRecordRepository extends JpaRepository<MissionRecord, Long> {}
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@

class MissionTest {

Member member;
Profile profile;
private static Member member;

@BeforeEach
void setUp() {
profile = new Profile("testNickname", "testProfileImageUrl");
Profile profile = new Profile("testNickname", "testProfileImageUrl");
member = Member.createNormalMember(profile);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,29 @@

class MissionRecordTest {

Member member;
Profile profile;
Mission mission;
private static Mission mission;

@BeforeEach
void setUp() {
profile = new Profile("testNickname", "testProfileImageUrl");
member = Member.createNormalMember(profile);
Profile profile = new Profile("testNickname", "testProfileImageUrl");
Member member = Member.createNormalMember(profile);
mission = Mission.registerPublicMission("testMissionName", "testMissionContent", member);
}

@Test
void 미션기록_업로드_상태_DEFAULT값은_NONE이다() {
// given
int duration = 32;
LocalDateTime startedAt = LocalDateTime.now();
LocalDateTime finishedAt = LocalDateTime.now().plusMinutes(duration);
MissionRecord missionRecord =
MissionRecord.createMissionRecord(
duration, "testMissionRecord_remark", startedAt, finishedAt, mission);

assertEquals(missionRecord.getUploadStatus(), ImageUploadStatus.NONE);
// when
ImageUploadStatus uploadStatus = missionRecord.getUploadStatus();

// then
assertEquals(ImageUploadStatus.NONE, uploadStatus);
}
}

0 comments on commit 40f085d

Please sign in to comment.