Skip to content

Commit

Permalink
Merge pull request #174 from WE-ARE-RACCOONS/develop
Browse files Browse the repository at this point in the history
RAC-325 deploy : ์šด์˜ ๋ฐ˜์˜
  • Loading branch information
ywj9811 authored Mar 14, 2024
2 parents aa0d278 + 02b4cc1 commit dfddbb3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import static com.postgraduate.domain.senior.application.mapper.SeniorMapper.mapToSeniorDetail;
import static com.postgraduate.domain.senior.application.mapper.SeniorMapper.mapToSeniorProfile;
import static com.postgraduate.domain.user.domain.entity.constant.Role.SENIOR;

@Service
@Transactional
Expand All @@ -30,7 +31,7 @@ public class SeniorInfoUseCase {
private final AvailableGetService availableGetService;

public SeniorDetailResponse getSeniorDetail(User user, Long seniorId) {
if (user != null)
if (user != null && user.getRole() == SENIOR)
return checkIsMine(user, seniorId);
return getResponse(seniorId, false);
}
Expand Down Expand Up @@ -99,9 +100,4 @@ public AllSeniorIdResponse getAllSeniorId() {
.toList();
return new AllSeniorIdResponse(seniorIds);
}

public Long getSeniorId(String nickName) {
Senior senior = seniorGetService.bySeniorNickName(nickName);
return senior.getSeniorId();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import static java.lang.Boolean.TRUE;
import static java.time.LocalDate.now;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.BDDMockito.given;

@ExtendWith(MockitoExtension.class)
Expand Down Expand Up @@ -64,14 +65,14 @@ void setting() {
LocalDateTime.now(), LocalDateTime.now());
}
@Test
@DisplayName("์„ ๋ฐฐ ์ƒ์„ธ๋ณด๊ธฐ ํ…Œ์ŠคํŠธ")
@DisplayName("์„ ๋ฐฐ ์ƒ์„ธ๋ณด๊ธฐ ํ…Œ์ŠคํŠธ USER")
void getSeniorDetail() {
Available available1 = new Available(1L, "์›”", "12:00", "18:00", senior);
Available available2 = new Available(2L, "ํ™”", "12:00", "18:00", senior);
Available available3 = new Available(3L, "์ˆ˜", "12:00", "18:00", senior);
List<Available> availables = List.of(available1, available2, available3);

given(seniorGetService.byUser(user))
given(seniorGetService.bySeniorIdWithCertification(any()))
.willReturn(senior);
given(availableGetService.bySenior(senior))
.willReturn(availables);
Expand Down

0 comments on commit dfddbb3

Please sign in to comment.