-
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.
HotFix: 보호자의 회원가입때만 환영 포인트 지급하도록 수정 (#212)
feat: 보호자의 회원가입때만 환영 포인트 지급하도록 수정
- Loading branch information
Showing
2 changed files
with
28 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
import com.example.sinitto.auth.service.TokenService; | ||
import com.example.sinitto.callback.service.CallbackService; | ||
import com.example.sinitto.common.exception.ConflictException; | ||
import com.example.sinitto.common.exception.NotFoundException; | ||
import com.example.sinitto.helloCall.service.HelloCallService; | ||
import com.example.sinitto.member.dto.RegisterResponse; | ||
import com.example.sinitto.member.entity.Member; | ||
|
@@ -49,8 +48,8 @@ public class MemberServiceTest { | |
PointLogRepository pointLogRepository; | ||
|
||
@Test | ||
@DisplayName("registerNewMember 메소드 테스트") | ||
void registerNewMemberTest() { | ||
@DisplayName("registerNewMember 메소드 테스트 - 시니또의 회원가입인 경우 환영 포인트 미지급") | ||
void registerNewMemberTest1() { | ||
//given | ||
String name = "testName"; | ||
String phoneNumber = "01000000000"; | ||
|
@@ -62,6 +61,27 @@ void registerNewMemberTest() { | |
//when | ||
RegisterResponse result = memberService.registerNewMember(name, phoneNumber, email, isSinitto); | ||
|
||
//then | ||
verify(memberRepository, times(1)).save(any(Member.class)); | ||
verify(pointRepository, never()).save(any()); | ||
verify(pointLogRepository, never()).save(any()); | ||
assertEquals(isSinitto, result.isSinitto()); | ||
} | ||
|
||
@Test | ||
@DisplayName("registerNewMember 메소드 테스트 - 보호자의 회원가입인 경우 환영 포인트 지급") | ||
void registerNewMemberTest2() { | ||
//given | ||
String name = "testName"; | ||
String phoneNumber = "01000000000"; | ||
String email = "[email protected]"; | ||
boolean isSinitto = false; | ||
|
||
when(memberRepository.existsByEmail(email)).thenReturn(false); | ||
|
||
//when | ||
RegisterResponse result = memberService.registerNewMember(name, phoneNumber, email, isSinitto); | ||
|
||
//then | ||
verify(memberRepository, times(1)).save(any(Member.class)); | ||
verify(pointRepository, times(1)).save(any()); | ||
|