From 368be131034acc772e5949997b33ca47802f53d6 Mon Sep 17 00:00:00 2001 From: seungsje <111065574+AreSain@users.noreply.github.com> Date: Sun, 8 Sep 2024 02:32:35 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[Bug]=20AdminTeamUpdate=EC=8B=9C?= =?UTF-8?q?=20=ED=8C=80=EC=9E=A5=20=EB=B9=84=EA=B5=90=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=20=EC=88=98=EC=A0=95=20#1006=20(#1007)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/admin/agendateam/service/AgendaTeamAdminService.java | 2 +- .../agendateam/controller/AgendaTeamAdminControllerTest.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gg-agenda-api/src/main/java/gg/agenda/api/admin/agendateam/service/AgendaTeamAdminService.java b/gg-agenda-api/src/main/java/gg/agenda/api/admin/agendateam/service/AgendaTeamAdminService.java index 1d99a9d18..7fd7cde5f 100644 --- a/gg-agenda-api/src/main/java/gg/agenda/api/admin/agendateam/service/AgendaTeamAdminService.java +++ b/gg-agenda-api/src/main/java/gg/agenda/api/admin/agendateam/service/AgendaTeamAdminService.java @@ -98,7 +98,7 @@ public void updateAgendaTeam(AgendaTeamUpdateDto agendaTeamUpdateDto) { }); // 팀장이 없는지 확인하는 로직 - if (profiles.stream().noneMatch(profile -> profile.getProfile().getIntraId().equals(team.getLeaderIntraId()))) { + if (!updatedTeamMates.contains(team.getLeaderIntraId())) { throw new NotExistException(TEAM_LEADER_NOT_FOUND); } } diff --git a/gg-agenda-api/src/test/java/gg/agenda/api/admin/agendateam/controller/AgendaTeamAdminControllerTest.java b/gg-agenda-api/src/test/java/gg/agenda/api/admin/agendateam/controller/AgendaTeamAdminControllerTest.java index ca9328888..27b777c1b 100644 --- a/gg-agenda-api/src/test/java/gg/agenda/api/admin/agendateam/controller/AgendaTeamAdminControllerTest.java +++ b/gg-agenda-api/src/test/java/gg/agenda/api/admin/agendateam/controller/AgendaTeamAdminControllerTest.java @@ -247,6 +247,7 @@ void updateAgendaTeamAdminSuccess() throws Exception { List updateTeamMates = profiles.stream() .map(profile -> new AgendaTeamMateReqDto(profile.getIntraId())) .collect(Collectors.toList()); + updateTeamMates.add(new AgendaTeamMateReqDto(seoulUserAgendaProfile.getIntraId())); AgendaTeamUpdateDto updateDto = AgendaTeamUpdateDto.builder() .teamKey(team.getTeamKey()).teamMates(updateTeamMates) .teamStatus(AgendaTeamStatus.CONFIRM).teamLocation(Location.MIX) @@ -328,6 +329,7 @@ void updateAgendaTeamAdminSuccessWithAddTeammate() throws Exception { List updateTeamMates = profiles.stream() .map(profile -> new AgendaTeamMateReqDto(profile.getIntraId())) .collect(Collectors.toList()); + updateTeamMates.add(new AgendaTeamMateReqDto(seoulUserAgendaProfile.getIntraId())); updateTeamMates.add(new AgendaTeamMateReqDto(newProfile.getIntraId())); AgendaTeamUpdateDto updateDto = AgendaTeamUpdateDto.builder() .teamKey(team.getTeamKey()).teamMates(updateTeamMates) @@ -437,6 +439,7 @@ void updateAgendaTeamAdminSuccessWithRemoveTeammate() throws Exception { List updateTeamMates = profiles.stream() .map(profile -> new AgendaTeamMateReqDto(profile.getIntraId())) .collect(Collectors.toList()); + updateTeamMates.add(new AgendaTeamMateReqDto(seoulUserAgendaProfile.getIntraId())); AgendaTeamUpdateDto updateDto = AgendaTeamUpdateDto.builder() .teamKey(team.getTeamKey()).teamMates(updateTeamMates) .teamStatus(AgendaTeamStatus.CONFIRM).teamLocation(Location.MIX)