From 34077ebd96d790070dcd68411b5632d68f7cf77a Mon Sep 17 00:00:00 2001 From: LeandroSilva Date: Thu, 4 Apr 2024 14:23:46 +0200 Subject: [PATCH] fix: * improve the test code --- .../api/service/session/SessionServiceTest.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/test/java/de/caritas/cob/userservice/api/service/session/SessionServiceTest.java b/src/test/java/de/caritas/cob/userservice/api/service/session/SessionServiceTest.java index bf14e1ee5..1c69b67ae 100644 --- a/src/test/java/de/caritas/cob/userservice/api/service/session/SessionServiceTest.java +++ b/src/test/java/de/caritas/cob/userservice/api/service/session/SessionServiceTest.java @@ -810,8 +810,7 @@ void initializeSession_Should_initializePeerChat_When_consultingTypeSettingsHasP agency.setAgencyId(4711L); var consultant = createConsultantWithAgencies(agency); var allowedSession = giveAllowedSessionWithID(1L, consultant); - var notAllowedSession = giveNotallowedSessionWithID(2L); - sessions.add(notAllowedSession); + sessions.add(giveAllowedSessionWithID(2L, null)); sessions.add(allowedSession); when(sessionRepository.findByGroupOrFeedbackGroupIds(singleton("rcGroupId"))) .thenReturn(sessions); @@ -914,13 +913,6 @@ private Session giveAllowedSessionWithID(Long id, Consultant consultant) { return allowedSession; } - private Session giveNotallowedSessionWithID(Long id) { - Session unhallowedSession = - createAnonymousNewEnquiryWithConsultingType(AGENCY_DTO_SUCHT.getConsultingType()); - unhallowedSession.setId(id); - return unhallowedSession; - } - private Session createAnonymousNewEnquiryWithConsultingType(int consultingTypeId) { var session = easyRandom.nextObject(Session.class); session.setAgencyId(null);