diff --git a/backend/src/test/java/com/funeat/acceptance/banner/BannerAcceptanceTest.java b/backend/src/test/java/com/funeat/acceptance/banner/BannerAcceptanceTest.java index de81c667..e5b3a39f 100644 --- a/backend/src/test/java/com/funeat/acceptance/banner/BannerAcceptanceTest.java +++ b/backend/src/test/java/com/funeat/acceptance/banner/BannerAcceptanceTest.java @@ -1,6 +1,6 @@ package com.funeat.acceptance.banner; -import static com.funeat.acceptance.banner.BannerSteps.배너_조회_요청; +import static com.funeat.acceptance.banner.BannerSteps.배너_목록_조회_요청; import static com.funeat.acceptance.common.CommonSteps.STATUS_CODE를_검증한다; import static com.funeat.acceptance.common.CommonSteps.정상_처리; import static com.funeat.fixture.BannerFixture.배너1_생성; @@ -36,10 +36,10 @@ class getBanners_성공_테스트 { final var 배너4 = 배너4_생성(); final var 배너5 = 배너5_생성(); final var 생성할_배너_리스트 = Arrays.asList(배너1, 배너2, 배너3, 배너4, 배너5); - bannerRepository.saveAllAndFlush(생성할_배너_리스트); + bannerRepository.saveAll(생성할_배너_리스트); // when - final var 응답 = 배너_조회_요청(); + final var 응답 = 배너_목록_조회_요청(); // then STATUS_CODE를_검증한다(응답, 정상_처리); @@ -47,7 +47,8 @@ class getBanners_성공_테스트 { } } - private void 배너_조회_결과를_검증한다(final ExtractableResponse response, final List expected) { + private void 배너_조회_결과를_검증한다(final ExtractableResponse response, + final List expected) { List expectedResponse = new ArrayList<>(); for (int i = expected.size() - 1; i >= 0; i--) { expectedResponse.add(BannerResponse.toResponse(expected.get(i))); @@ -55,7 +56,7 @@ class getBanners_성공_테스트 { final List result = response.jsonPath().getList("$", BannerResponse.class); assertThat(result).usingRecursiveComparison() - .ignoringFields("id") - .isEqualTo(expectedResponse); + .ignoringFields("id") + .isEqualTo(expectedResponse); } } diff --git a/backend/src/test/java/com/funeat/acceptance/banner/BannerSteps.java b/backend/src/test/java/com/funeat/acceptance/banner/BannerSteps.java index 20f61f2d..6fbc155f 100644 --- a/backend/src/test/java/com/funeat/acceptance/banner/BannerSteps.java +++ b/backend/src/test/java/com/funeat/acceptance/banner/BannerSteps.java @@ -7,11 +7,11 @@ @SuppressWarnings("NonAsciiCharacters") public class BannerSteps { - public static ExtractableResponse 배너_조회_요청() { + public static ExtractableResponse 배너_목록_조회_요청() { return RestAssured.given() - .when() - .get("/api/banners") - .then() - .extract(); + .when() + .get("/api/banners") + .then() + .extract(); } } diff --git a/backend/src/test/java/com/funeat/common/ServiceTest.java b/backend/src/test/java/com/funeat/common/ServiceTest.java index 51e2362b..23ee634f 100644 --- a/backend/src/test/java/com/funeat/common/ServiceTest.java +++ b/backend/src/test/java/com/funeat/common/ServiceTest.java @@ -206,7 +206,6 @@ public abstract class ServiceTest { productRecipeRepository.saveAll(productRecipes); } - protected void 복수_배너_저장(final Banner... bannerToSave) { final List banners = List.of(bannerToSave);