Skip to content

Commit

Permalink
fix: adapt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippFr committed Oct 12, 2022
1 parent 8952541 commit bb3098c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public Consultant updateConsultantAbsent(Consultant consultant, AbsenceDTO absen
return this.consultantService.saveConsultant(consultant);
}

public GroupSessionListResponseDTO addConsultantDisplayNameToSessionList(
GroupSessionListResponseDTO groupSessionList) {
public void addConsultantDisplayNameToSessionList(GroupSessionListResponseDTO groupSessionList) {
groupSessionList
.getSessions()
.forEach(
Expand All @@ -55,11 +54,9 @@ public GroupSessionListResponseDTO addConsultantDisplayNameToSessionList(
consultant.setDisplayName(userDtoMapper.displayNameOf(consultantMap)));
}
});
return groupSessionList;
}

public UserSessionListResponseDTO addConsultantDisplayNameToSessionList(
UserSessionListResponseDTO userSessionsDTO) {
public void addConsultantDisplayNameToSessionList(UserSessionListResponseDTO userSessionsDTO) {
userSessionsDTO
.getSessions()
.forEach(
Expand All @@ -73,6 +70,5 @@ public UserSessionListResponseDTO addConsultantDisplayNameToSessionList(
consultant.setDisplayName(userDtoMapper.displayNameOf(consultantMap)));
}
});
return userSessionsDTO;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import de.caritas.cob.userservice.api.config.auth.IdentityConfig;
import de.caritas.cob.userservice.api.config.auth.UserRole;
import de.caritas.cob.userservice.api.exception.rocketchat.RocketChatUserNotInitializedException;
import de.caritas.cob.userservice.api.facade.userdata.ConsultantDataFacade;
import de.caritas.cob.userservice.api.helper.AuthenticatedUser;
import de.caritas.cob.userservice.api.helper.CustomLocalDateTime;
import de.caritas.cob.userservice.api.helper.UsernameTranscoder;
Expand Down Expand Up @@ -162,6 +163,8 @@ class UserControllerSessionE2EIT {

@MockBean private RocketChatCredentialsProvider rocketChatCredentialsProvider;

@MockBean private ConsultantDataFacade consultantDataFacade;

@MockBean
@Qualifier("restTemplate")
private RestTemplate restTemplate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void addConsultantDisplayNameToSessionList_GroupSession_Should_AddConsult
when(userDtoMapper.displayNameOf(map)).thenReturn(displayName);
when(accountManager.findConsultantByUsername(userName)).thenReturn(Optional.of(map));

response = consultantDataFacade.addConsultantDisplayNameToSessionList(response);
consultantDataFacade.addConsultantDisplayNameToSessionList(response);

assertEquals(displayName, response.getSessions().get(0).getConsultant().getDisplayName());
}
Expand All @@ -123,7 +123,7 @@ public void addConsultantDisplayNameToSessionList_UserSession_Should_AddConsulta
when(userDtoMapper.displayNameOf(map)).thenReturn(displayName);
when(accountManager.findConsultantByUsername(userName)).thenReturn(Optional.of(map));

response = consultantDataFacade.addConsultantDisplayNameToSessionList(response);
consultantDataFacade.addConsultantDisplayNameToSessionList(response);

assertEquals(displayName, response.getSessions().get(0).getConsultant().getDisplayName());
}
Expand Down

0 comments on commit bb3098c

Please sign in to comment.