Skip to content

Commit

Permalink
[TEST] 개발언어가 존재하지 않는 경우 테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
tidavid1 committed Mar 26, 2024
1 parent bdeb5b6 commit 96ec3a3
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
@ExtendWith(MockitoExtension.class)
@DisplayName("서비스 테스트: UserService")
class UserServiceTest {

@InjectMocks
private UserService userService;
@Mock
Expand Down Expand Up @@ -131,6 +132,19 @@ void init() {
.contains(300, 200, 100);
}

@Test
void 유저_개발언어_업데이트_레포지토리가_존재하지_않는_경우() {
// Arrange
var expectedUserId = 1L;
when(userCommonService.getUserById(expectedUserId)).thenReturn(user);
when(userGithubUtil.updateUserDevelopLanguage(any(String.class))).thenReturn(Map.of());
// Act
var actualResult = userService.updateUserDevelopLanguages(expectedUserId);
// Assert
assertThat(actualResult).isNotNull().hasSize(1).extracting("language")
.contains(DevelopLanguage.NULL);
}

@Test
void 유저_프로필_조회() {
// Arrange
Expand Down Expand Up @@ -181,7 +195,7 @@ void init() {
}

@Test
void 유저_잔디력_조회(){
void 유저_잔디력_조회() {
// Arrange
var expectedUserId = 1L;
when(userCommonService.getUserById(expectedUserId)).thenReturn(user);
Expand Down

0 comments on commit 96ec3a3

Please sign in to comment.