Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
* run mvn spotless:apply
  • Loading branch information
Leandro13Silva13 committed Apr 4, 2024
1 parent 98e9f58 commit 37ca173
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
Expand Down Expand Up @@ -446,9 +445,10 @@ private List<AgencyDTO> fetchAgencies(List<Session> sessions) {
checkForUserOrConsultantRole(roles);
var sessions = sessionRepository.findByGroupOrFeedbackGroupIds(rcGroupIds);

List<Session> allowedSessions = sessions.stream()
.filter(session -> isConsultantPermittedToSession(consultant, session))
.collect(Collectors.toList());
List<Session> allowedSessions =
sessions.stream()
.filter(session -> isConsultantPermittedToSession(consultant, session))
.collect(Collectors.toList());

return mapSessionsToConsultantSessionDto(allowedSessions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ void initializeSession_Should_initializePeerChat_When_consultingTypeSettingsHasP
@Test
void
getAllowedSessionsByConsultantAndGroupOrFeedbackGroupIds_should_only_return_the_sessions_the_consultant_can_see() {
//given
// given
List<Session> sessions = new ArrayList<>();
ConsultantAgency agency = new ConsultantAgency();
agency.setAgencyId(4711L);
Expand All @@ -815,11 +815,11 @@ void initializeSession_Should_initializePeerChat_When_consultingTypeSettingsHasP
sessions.add(allowedSession);
when(sessionRepository.findByGroupOrFeedbackGroupIds(singleton("rcGroupId")))
.thenReturn(sessions);
//when
// when
var sessionResponse =
sessionService.getAllowedSessionsByConsultantAndGroupOrFeedbackGroupIds(
consultant, singleton("rcGroupId"), singleton(UserRole.CONSULTANT.getValue()));
//then
// then
assertThat(sessionResponse).hasSize(1);
assertThat(sessionResponse.get(0).getSession().getId()).isEqualTo(allowedSession.getId());
}
Expand Down Expand Up @@ -906,15 +906,15 @@ private List<UserSessionResponseDTO> getSomeUserId(String someUserId, Session an
someUserId, singleton(anonymousEnquiry.getId()), singleton(UserRole.ANONYMOUS.getValue()));
}

private Session giveAllowedSessionWithID(Long id, Consultant consultant){
private Session giveAllowedSessionWithID(Long id, Consultant consultant) {
Session allowedSession =
createAnonymousNewEnquiryWithConsultingType(AGENCY_DTO_SUCHT.getConsultingType());
allowedSession.setId(id);
allowedSession.setConsultant(consultant);
return allowedSession;
}

private Session giveUnhallowedSessionWithID(Long id){
private Session giveUnhallowedSessionWithID(Long id) {
Session unhallowedSession =
createAnonymousNewEnquiryWithConsultingType(AGENCY_DTO_SUCHT.getConsultingType());
unhallowedSession.setId(id);
Expand Down

0 comments on commit 37ca173

Please sign in to comment.