Skip to content

Commit

Permalink
refactor: 가족 없을 때 test 변경 #245
Browse files Browse the repository at this point in the history
  • Loading branch information
ozzing committed Sep 29, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 3198ef5 commit ba8c079
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@
import com.ceos.bankids.repository.ProgressRepository;
import com.ceos.bankids.repository.TargetItemRepository;
import com.ceos.bankids.service.ChallengeServiceImpl;
import com.ceos.bankids.service.FamilyServiceImpl;
import java.util.Optional;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
@@ -112,9 +111,7 @@ public void testIfPostChallengeReqSuccessResponse() {
mockProgressRepository,
mockCommentRepository
);
FamilyServiceImpl familyService = new FamilyServiceImpl()


// FamilyServiceImpl familyService = new FamilyServiceImpl()

}
}
Original file line number Diff line number Diff line change
@@ -334,8 +334,8 @@ public void testIfFamilyExistThenReturnGetResult() {
}

@Test
@DisplayName("조회 시 기존 가족 있으나, 삭제되었을 때 에러 처리 하는지 확인")
public void testIfFamilyExistedButDeletedWhenGetThenThrowBadRequestException() {
@DisplayName("조회 시 기존 가족 없을 때, 빈 가족 정보 리턴 하는지 확인")
public void testIfFamilyNotExistThenReturnResult() {
// given
User user1 = User.builder()
.id(1L)
@@ -393,10 +393,13 @@ public void testIfFamilyExistedButDeletedWhenGetThenThrowBadRequestException() {
);
FamilyController familyController = new FamilyController(familyMapper);

CommonResponse<FamilyDTO> result = familyController.getFamily(user1);

// then
Assertions.assertThrows(BadRequestException.class, () -> {
familyController.getFamily(user1);
});
FamilyDTO familyDTO = FamilyDTO.builder()
.family(new Family())
.familyUserList(List.of()).build();
Assertions.assertEquals(CommonResponse.onSuccess(familyDTO), result);
}

@Test

0 comments on commit ba8c079

Please sign in to comment.