File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
src/test/java/com/somemore/center Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments