-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
165 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
src/main/java/com/nexters/goalpanzi/application/mission/event/CompleteMissionEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package com.nexters.goalpanzi.application.mission.event; | ||
|
||
public record CompleteMissionEvent( | ||
Long missionId, | ||
String nickname | ||
Long missionId | ||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...est/java/com/nexters/goalpanzi/domain/mission/repository/MissionMemberRepositoryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.nexters.goalpanzi.domain.mission.repository; | ||
|
||
import com.nexters.goalpanzi.domain.member.Member; | ||
import com.nexters.goalpanzi.domain.member.SocialType; | ||
import com.nexters.goalpanzi.domain.member.repository.MemberRepository; | ||
import com.nexters.goalpanzi.domain.mission.InvitationCode; | ||
import com.nexters.goalpanzi.domain.mission.Mission; | ||
import com.nexters.goalpanzi.domain.mission.MissionMember; | ||
import com.nexters.goalpanzi.domain.mission.TimeOfDay; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import static com.nexters.goalpanzi.fixture.MemberFixture.EMAIL_HOST; | ||
import static com.nexters.goalpanzi.fixture.MemberFixture.SOCIAL_ID; | ||
import static com.nexters.goalpanzi.fixture.MissionFixture.*; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.junit.jupiter.api.Assertions.assertAll; | ||
|
||
@DataJpaTest | ||
class MissionMemberRepositoryTest { | ||
|
||
@Autowired | ||
private MissionMemberRepository missionMemberRepository; | ||
|
||
@Autowired | ||
private MemberRepository memberRepository; | ||
|
||
@Autowired | ||
private MissionRepository missionRepository; | ||
|
||
private final Member MEMBER = Member.socialLogin(SOCIAL_ID, EMAIL_HOST, SocialType.GOOGLE); | ||
|
||
@Test | ||
void 미션_멤버를_멤버와_미션과_함께_조회한다() { | ||
Member member = memberRepository.save(MEMBER); | ||
Mission mission = missionRepository.save( | ||
Mission.create( | ||
member.getId(), | ||
DESCRIPTION, | ||
LocalDateTime.now().plusDays(1), | ||
LocalDateTime.now().plusDays(31), | ||
TimeOfDay.EVERYDAY, | ||
WEEK, | ||
BOARD_COUNT, | ||
InvitationCode.generate() | ||
) | ||
); | ||
missionMemberRepository.save(MissionMember.join(member, mission)); | ||
|
||
MissionMember missionMember = missionMemberRepository.getMissionMemberWithMemberAndMission(member.getId(), mission.getId()); | ||
assertAll( | ||
() -> assertThat(missionMember.getMember()).isEqualTo(member), | ||
() -> assertThat(missionMember.getMission()).isEqualTo(mission) | ||
); | ||
} | ||
} |