Skip to content

Commit

Permalink
refactor: 레시피에 사용된 상품 정보를 새로운 DTO로 사용하면서 검증할 DTO 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
70825 committed Mar 27, 2024
1 parent 2536266 commit 911a7c9
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,7 @@
import com.funeat.acceptance.common.AcceptanceTest;
import com.funeat.member.domain.Member;
import com.funeat.recipe.domain.Recipe;
import com.funeat.recipe.dto.ProductRecipeDto;
import com.funeat.recipe.dto.RankingRecipeDto;
import com.funeat.recipe.dto.RecipeAuthorDto;
import com.funeat.recipe.dto.RecipeCommentCondition;
import com.funeat.recipe.dto.RecipeCommentCreateRequest;
import com.funeat.recipe.dto.RecipeCommentResponse;
import com.funeat.recipe.dto.RecipeCreateRequest;
import com.funeat.recipe.dto.RecipeDetailResponse;
import com.funeat.recipe.dto.RecipeDto;
import com.funeat.recipe.dto.SearchRecipeResultDto;
import com.funeat.recipe.dto.*;
import io.restassured.response.ExtractableResponse;
import io.restassured.response.Response;
import java.util.Collections;
Expand Down Expand Up @@ -743,7 +734,7 @@ class getRecipeComment_실패_테스트 {
private void 레시피_상세_정보_조회_결과를_검증한다(final ExtractableResponse<Response> response) {
final var actual = response.as(RecipeDetailResponse.class);
final var actualAuthor = response.jsonPath().getObject("author", RecipeAuthorDto.class);
final var actualProducts = response.jsonPath().getList("products", ProductRecipeDto.class);
final var actualProducts = response.jsonPath().getList("products", DetailProductRecipeDto.class);

assertSoftly(soft -> {
soft.assertThat(actual.getId()).isEqualTo(1L);
Expand All @@ -755,7 +746,7 @@ class getRecipeComment_실패_테스트 {
soft.assertThat(actual.getFavorite()).isEqualTo(false);
soft.assertThat(actualAuthor.getNickname()).isEqualTo("member1");
soft.assertThat(actualAuthor.getProfileImage()).isEqualTo("www.member1.com");
soft.assertThat(actualProducts).extracting(ProductRecipeDto::getId)
soft.assertThat(actualProducts).extracting(DetailProductRecipeDto::getId)
.containsExactlyElementsOf(List.of(1L, 2L));
});
}
Expand Down

0 comments on commit 911a7c9

Please sign in to comment.