Skip to content

Commit 302f78e

Browse files
committed
test(center): center 아이디로 센터명 조회하는 메서드 변경으로 인한 Test 수정
1 parent 5dbad40 commit 302f78e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/test/java/com/somemore/center/repository/NEWCenterRepositoryImplTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,22 @@ void findNameById() {
132132
userCommonAttributeRepository.save(centerUserInfo);
133133

134134
//when
135-
String foundName = centerRepository.findNameById(center.getId());
135+
Optional<String> foundName = centerRepository.findNameById(center.getId());
136136

137137
//then
138-
AssertionsForClassTypes.assertThat(foundName).isNotNull();
139-
AssertionsForClassTypes.assertThat(foundName).contains("기관");
138+
assertThat(foundName).isPresent();
139+
assertThat(foundName.get()).contains("기관");
140140
}
141141

142142
@DisplayName("존재하지 않는 기관 id로 기관명 조회 시 null을 반환한다.")
143143
@Test
144144
void findNameByNonExistentId() {
145145
//given
146146
//when
147-
String foundName = centerRepository.findNameById(UUID.randomUUID());
147+
Optional<String> foundName = centerRepository.findNameById(UUID.randomUUID());
148148

149149
//then
150-
AssertionsForClassTypes.assertThat(foundName).isNull();
150+
assertThat(foundName).isEmpty();
151151
}
152152

153153
private UserCommonAttribute createCenterUserAttribute(UUID userId) {

src/test/java/com/somemore/center/service/NEWCenterQueryServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void getNameByNonExistentId() {
165165
UUID.randomUUID());
166166

167167
// then
168-
assertThatExceptionOfType(BadRequestException.class)
168+
assertThatExceptionOfType(NoSuchElementException.class)
169169
.isThrownBy(callable)
170170
.withMessage(ExceptionMessage.NOT_EXISTS_CENTER.getMessage());
171171
}

0 commit comments

Comments
 (0)