test(store): Just pick-up 매장 메뉴 페이지 테스트
This commit is contained in:
@@ -95,8 +95,8 @@ operation::put-categoryList[snippets='curl-request,http-request,http-response,re
|
||||
== 매장
|
||||
=== 매장 검색 조회
|
||||
operation::api-customer-store-search[snippets='curl-request,http-request,http-response,request-parameters,response-fields']
|
||||
|
||||
=== 자주찾는 매장
|
||||
operation::favoriteStore-get[snippets='curl-request,http-request,http-response,request-headers,request-parameters,response-fields']
|
||||
|
||||
=== 매장 조회
|
||||
operation::store-get[snippets='curl-request,http-request,http-response,path-parameters,response-fields']
|
||||
|
||||
|
||||
@@ -1,27 +1,8 @@
|
||||
package com.justpickup.storeservice;
|
||||
|
||||
import com.justpickup.storeservice.domain.category.dto.CategoryDto;
|
||||
import com.justpickup.storeservice.domain.category.entity.Category;
|
||||
import com.justpickup.storeservice.domain.category.repository.CategoryRepository;
|
||||
import com.justpickup.storeservice.domain.favoritestore.entity.FavoriteStore;
|
||||
import com.justpickup.storeservice.domain.favoritestore.repository.FavoriteStoreRepository;
|
||||
import com.justpickup.storeservice.domain.item.entity.Item;
|
||||
import com.justpickup.storeservice.domain.item.repository.ItemRepository;
|
||||
import com.justpickup.storeservice.domain.item.service.ItemService;
|
||||
import com.justpickup.storeservice.domain.itemoption.entity.ItemOption;
|
||||
import com.justpickup.storeservice.domain.itemoption.entity.OptionType;
|
||||
import com.justpickup.storeservice.domain.map.entity.Map;
|
||||
import com.justpickup.storeservice.domain.store.entity.Store;
|
||||
import com.justpickup.storeservice.domain.store.repository.StoreRepository;
|
||||
import com.justpickup.storeservice.global.entity.Address;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableEurekaClient
|
||||
@@ -31,80 +12,4 @@ public class StoreServiceApplication {
|
||||
SpringApplication.run(StoreServiceApplication.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
CommandLineRunner run(StoreRepository storeRepository, FavoriteStoreRepository favoriteStoreRepository,
|
||||
ItemRepository itemRepository, CategoryRepository categoryRepository) {
|
||||
return args -> {
|
||||
List<Store> stores = new ArrayList<>();
|
||||
|
||||
createStores(storeRepository, stores);
|
||||
|
||||
createFavoriteStore(favoriteStoreRepository, stores);
|
||||
|
||||
stores.forEach(store -> {
|
||||
Category 카페인 = categoryRepository.save(Category.of("카페인", 0, store));
|
||||
Category 디카페인 = categoryRepository.save(Category.of("디카페인", 1, store));
|
||||
Category 티 = categoryRepository.save(Category.of("티", 2, store));
|
||||
|
||||
ItemOption ice = ItemOption.of(OptionType.REQUIRED, "ICE");
|
||||
ItemOption hot = ItemOption.of(OptionType.REQUIRED, "HOT");
|
||||
|
||||
Item 아메리카노 = Item.of("아메리카노", 1500L, 카페인, store, List.of(ice, hot));
|
||||
Item 카페라떼 = Item.of("카페라떼", 2000L, 카페인, store, List.of(ice, hot));
|
||||
Item 카페모카 = Item.of("카페모카", 3900L, 카페인, store, List.of(ice, hot));
|
||||
Item 콜드브루 = Item.of("콜드브루", 2500L, 카페인, store, List.of(ice));
|
||||
Item 녹차라떼 = Item.of("녹차라떼", 3000L, 디카페인, store, List.of(ice, hot));
|
||||
Item 딸기라떼 = Item.of("딸기라떼", 3000L, 디카페인, store, List.of(ice, hot));
|
||||
Item 녹차 = Item.of("녹차", 3000L, 티, store, List.of(hot));
|
||||
Item 히비스커스 = Item.of("히비스커스 티", 3000L, 티, store, List.of(hot));
|
||||
itemRepository.saveAll(List.of(아메리카노, 카페라떼, 콜드브루, 녹차라떼, 딸기라떼, 녹차, 히비스커스));
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
private void createFavoriteStore(FavoriteStoreRepository favoriteStoreRepository, List<Store> stores) {
|
||||
List<Long> userList = List.of(1L,2L,3L,4L,5L,6L,7L);
|
||||
userList.forEach(userId -> stores.forEach(store -> favoriteStoreRepository.save(FavoriteStore.of(userId, store))));
|
||||
}
|
||||
|
||||
private void createStores(StoreRepository storeRepository, List<Store> stores) {
|
||||
stores.add(
|
||||
Store.of(
|
||||
new Address("서울시", "마포구 도화동", "201-20"),
|
||||
Map.of(37.5398271003404, 126.94769672415691),
|
||||
1L,
|
||||
"커피온리 마포역점"
|
||||
)
|
||||
);
|
||||
|
||||
stores.add(
|
||||
Store.of(
|
||||
new Address("서울시", "마포구 도화동", "50-10"),
|
||||
Map.of(37.54010719003089, 126.94556661330861),
|
||||
2L,
|
||||
"만랩커피 마포점"
|
||||
)
|
||||
);
|
||||
|
||||
stores.add(
|
||||
Store.of(
|
||||
new Address("서울시", "마포구 도화동", "555"),
|
||||
Map.of(37.539797393793755, 126.9453578838543),
|
||||
3L,
|
||||
"이디야커피 마포오벨리스크점"
|
||||
)
|
||||
);
|
||||
|
||||
stores.add(
|
||||
Store.of(
|
||||
new Address("서울시", "영등포구 도림로", "31길 2"),
|
||||
Map.of(37.493033141569505, 126.89593667847592),
|
||||
4L,
|
||||
"이디야커피 대림역점"
|
||||
)
|
||||
);
|
||||
|
||||
storeRepository.saveAll(stores);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ItemDto {
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ItemDto createWithCategoryItemDto(Item item) {
|
||||
public static ItemDto createWithCategory(Item item) {
|
||||
return ItemDto.builder()
|
||||
.id(item.getId())
|
||||
.name(item.getName())
|
||||
@@ -79,9 +79,4 @@ public class ItemDto {
|
||||
.build();
|
||||
}
|
||||
|
||||
// TODO: 2022/02/03 queryDsl 쿼리 생성 시 구현 필요
|
||||
// public static ItemDto createFullItemDto(Item item) {
|
||||
// return null
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
package com.justpickup.storeservice.domain.item.repository;
|
||||
|
||||
import com.justpickup.storeservice.domain.item.entity.Item;
|
||||
import com.justpickup.storeservice.domain.store.entity.Store;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ItemRepository extends JpaRepository<Item, Long> {
|
||||
|
||||
List<Item> findByStore(Store store);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package com.justpickup.storeservice.domain.itemoption.repository;
|
||||
|
||||
import com.justpickup.storeservice.domain.item.entity.Item;
|
||||
import com.justpickup.storeservice.domain.item.entity.QItem;
|
||||
import com.justpickup.storeservice.domain.itemoption.entity.ItemOption;
|
||||
import com.justpickup.storeservice.domain.itemoption.entity.QItemOption;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.justpickup.storeservice.domain.item.entity.QItem.item;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class ItemOptionRepositoryCustom {
|
||||
@@ -21,7 +20,9 @@ public class ItemOptionRepositoryCustom {
|
||||
|
||||
return queryFactory.selectFrom(QItemOption.itemOption)
|
||||
.join(QItemOption.itemOption.item)
|
||||
.on(QItem.item.id.eq(itemId))
|
||||
.on(item.id.eq(itemId))
|
||||
.fetch();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.justpickup.storeservice.domain.store.dto;
|
||||
|
||||
import com.justpickup.storeservice.domain.store.entity.Store;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class StoreDto {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String phoneNumber;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.justpickup.storeservice.domain.store.repository;
|
||||
|
||||
import com.justpickup.storeservice.domain.favoritestore.entity.FavoriteStore;
|
||||
import com.justpickup.storeservice.domain.favoritestore.entity.QFavoriteStore;
|
||||
import com.justpickup.storeservice.domain.store.dto.SearchStoreCondition;
|
||||
import com.justpickup.storeservice.domain.store.dto.SearchStoreResult;
|
||||
@@ -83,7 +82,7 @@ public class StoreRepositoryCustom {
|
||||
return content;
|
||||
}
|
||||
|
||||
private NumberExpression<Double> getHaversineDistance (double SearchLatitude, double SearchLongitude){
|
||||
private NumberExpression<Double> getHaversineDistance(double SearchLatitude, double SearchLongitude){
|
||||
Expression<Double> latitude = Expressions.constant(SearchLatitude);
|
||||
Expression<Double> longitude = Expressions.constant(SearchLongitude);
|
||||
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.justpickup.storeservice.global;
|
||||
|
||||
import com.justpickup.storeservice.domain.category.entity.Category;
|
||||
import com.justpickup.storeservice.domain.category.repository.CategoryRepository;
|
||||
import com.justpickup.storeservice.domain.favoritestore.entity.FavoriteStore;
|
||||
import com.justpickup.storeservice.domain.favoritestore.repository.FavoriteStoreRepository;
|
||||
import com.justpickup.storeservice.domain.item.entity.Item;
|
||||
import com.justpickup.storeservice.domain.item.repository.ItemRepository;
|
||||
import com.justpickup.storeservice.domain.itemoption.entity.ItemOption;
|
||||
import com.justpickup.storeservice.domain.itemoption.entity.OptionType;
|
||||
import com.justpickup.storeservice.domain.map.entity.Map;
|
||||
import com.justpickup.storeservice.domain.store.entity.Store;
|
||||
import com.justpickup.storeservice.domain.store.repository.StoreRepository;
|
||||
import com.justpickup.storeservice.global.entity.Address;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SqlCommandLineRunner implements CommandLineRunner {
|
||||
|
||||
private final StoreRepository storeRepository;
|
||||
private final FavoriteStoreRepository favoriteStoreRepository;
|
||||
private final ItemRepository itemRepository;
|
||||
private final CategoryRepository categoryRepository;
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
List<Store> stores = new ArrayList<>();
|
||||
|
||||
createStores(storeRepository, stores);
|
||||
|
||||
createFavoriteStore(favoriteStoreRepository, stores);
|
||||
|
||||
createItemAndCategories(itemRepository, categoryRepository, stores);
|
||||
}
|
||||
|
||||
private void createItemAndCategories(ItemRepository itemRepository, CategoryRepository categoryRepository, List<Store> stores) {
|
||||
stores.forEach(store -> {
|
||||
Category 카페인 = categoryRepository.save(Category.of("카페인", 0, store));
|
||||
Category 디카페인 = categoryRepository.save(Category.of("디카페인", 1, store));
|
||||
Category 티 = categoryRepository.save(Category.of("티", 2, store));
|
||||
|
||||
ItemOption ice = ItemOption.of(OptionType.REQUIRED, "ICE");
|
||||
ItemOption hot = ItemOption.of(OptionType.REQUIRED, "HOT");
|
||||
|
||||
Item 아메리카노 = Item.of("아메리카노", 1500L, 카페인, store, List.of(ice, hot));
|
||||
Item 카페라떼 = Item.of("카페라떼", 2000L, 카페인, store, List.of(ice, hot));
|
||||
Item 카페모카 = Item.of("카페모카", 3900L, 카페인, store, List.of(ice, hot));
|
||||
Item 콜드브루 = Item.of("콜드브루", 2500L, 카페인, store, List.of(ice));
|
||||
Item 녹차라떼 = Item.of("녹차라떼", 3000L, 디카페인, store, List.of(ice, hot));
|
||||
Item 딸기라떼 = Item.of("딸기라떼", 3000L, 디카페인, store, List.of(ice, hot));
|
||||
Item 녹차 = Item.of("녹차", 3000L, 티, store, List.of(hot));
|
||||
Item 히비스커스 = Item.of("히비스커스 티", 3000L, 티, store, List.of(hot));
|
||||
itemRepository.saveAll(List.of(아메리카노, 카페라떼, 콜드브루, 녹차라떼, 딸기라떼, 녹차, 히비스커스));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void createFavoriteStore(FavoriteStoreRepository favoriteStoreRepository, List<Store> stores) {
|
||||
List<Long> userList = List.of(1L,2L,3L,4L,5L,6L,7L);
|
||||
userList.forEach(userId -> stores.forEach(store -> favoriteStoreRepository.save(FavoriteStore.of(userId, store))));
|
||||
}
|
||||
|
||||
private void createStores(StoreRepository storeRepository, List<Store> stores) {
|
||||
stores.add(
|
||||
Store.of(
|
||||
new Address("서울시", "마포구 도화동", "201-20"),
|
||||
Map.of(37.5398271003404, 126.94769672415691),
|
||||
1L,
|
||||
"커피온리 마포역점"
|
||||
)
|
||||
);
|
||||
|
||||
stores.add(
|
||||
Store.of(
|
||||
new Address("서울시", "마포구 도화동", "50-10"),
|
||||
Map.of(37.54010719003089, 126.94556661330861),
|
||||
2L,
|
||||
"만랩커피 마포점"
|
||||
)
|
||||
);
|
||||
|
||||
stores.add(
|
||||
Store.of(
|
||||
new Address("서울시", "마포구 도화동", "555"),
|
||||
Map.of(37.539797393793755, 126.9453578838543),
|
||||
3L,
|
||||
"이디야커피 마포오벨리스크점"
|
||||
)
|
||||
);
|
||||
|
||||
stores.add(
|
||||
Store.of(
|
||||
new Address("서울시", "영등포구 도림로", "31길 2"),
|
||||
Map.of(37.493033141569505, 126.89593667847592),
|
||||
4L,
|
||||
"이디야커피 대림역점"
|
||||
)
|
||||
);
|
||||
|
||||
storeRepository.saveAll(stores);
|
||||
}
|
||||
}
|
||||
@@ -45,17 +45,9 @@ class CategoryOwnerApiControllerTest {
|
||||
@MockBean
|
||||
private CategoryService categoryService;
|
||||
|
||||
@MockBean
|
||||
private StoreRepository storeRepository;
|
||||
|
||||
@MockBean
|
||||
private FavoriteStoreRepository favoriteStoreRepository;
|
||||
|
||||
|
||||
@Test
|
||||
@DisplayName("카테고리리스트_가져오기_성공")
|
||||
void getCategoryList_success() throws Exception {
|
||||
|
||||
//given
|
||||
Long storeId = 1L;
|
||||
List<CategoryDto> categoryDtoList = new ArrayList<>();
|
||||
@@ -108,7 +100,6 @@ class CategoryOwnerApiControllerTest {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@DisplayName("카테고리리스트_수정_성공")
|
||||
void putCategoryList_success() throws Exception {
|
||||
|
||||
@@ -56,12 +56,6 @@ class ItemOwnerApiControllerTest {
|
||||
@MockBean
|
||||
ItemService itemService;
|
||||
|
||||
@MockBean
|
||||
private StoreRepository storeRepository;
|
||||
|
||||
@MockBean
|
||||
private FavoriteStoreRepository favoriteStoreRepository;
|
||||
|
||||
@Test
|
||||
@DisplayName("상품 리스트 조회")
|
||||
void getItemList() throws Exception {
|
||||
@@ -177,9 +171,9 @@ class ItemOwnerApiControllerTest {
|
||||
Long categoryId = 1L;
|
||||
|
||||
List<ItemOwnerApiController.ItemRequest.ItemOptionRequest> requiredOption =
|
||||
List.of(new ItemOwnerApiController.ItemRequest.ItemOptionRequest(null, "HOT",OptionType.REQUIRED,null));
|
||||
List.of(new ItemOwnerApiController.ItemRequest.ItemOptionRequest(null, "HOT",OptionType.REQUIRED));
|
||||
List<ItemOwnerApiController.ItemRequest.ItemOptionRequest> otherOption =
|
||||
List.of(new ItemOwnerApiController.ItemRequest.ItemOptionRequest(null, "샷 추가",OptionType.OTHER,null));
|
||||
List.of(new ItemOwnerApiController.ItemRequest.ItemOptionRequest(null, "샷 추가", OptionType.OTHER));
|
||||
|
||||
|
||||
ItemOwnerApiController.ItemRequest itemRequest =
|
||||
@@ -208,12 +202,10 @@ class ItemOwnerApiControllerTest {
|
||||
fieldWithPath("requiredOption[*].id").description("옵션 고유번호"),
|
||||
fieldWithPath("requiredOption[*].name").description("옵션 이름"),
|
||||
fieldWithPath("requiredOption[*].optionType").description("옵션 타입"),
|
||||
fieldWithPath("requiredOption[*].price").description("옵션 가격"),
|
||||
fieldWithPath("otherOption").description("추가옵션"),
|
||||
fieldWithPath("otherOption[*].id").description("옵션 고유번호"),
|
||||
fieldWithPath("otherOption[*].name").description("옵션 이름"),
|
||||
fieldWithPath("otherOption[*].optionType").description("옵션 타입"),
|
||||
fieldWithPath("otherOption[*].price").description("옵션 가격")
|
||||
fieldWithPath("otherOption[*].optionType").description("옵션 타입")
|
||||
))
|
||||
);
|
||||
}
|
||||
@@ -227,9 +219,9 @@ class ItemOwnerApiControllerTest {
|
||||
Long categoryId = 1L;
|
||||
|
||||
List<ItemOwnerApiController.ItemRequest.ItemOptionRequest> requiredOption =
|
||||
List.of(new ItemOwnerApiController.ItemRequest.ItemOptionRequest(null, "HOT",OptionType.REQUIRED,null));
|
||||
List.of(new ItemOwnerApiController.ItemRequest.ItemOptionRequest(null, "HOT",OptionType.REQUIRED));
|
||||
List<ItemOwnerApiController.ItemRequest.ItemOptionRequest> otherOption =
|
||||
List.of(new ItemOwnerApiController.ItemRequest.ItemOptionRequest(null, "샷 추가",OptionType.OTHER,null));
|
||||
List.of(new ItemOwnerApiController.ItemRequest.ItemOptionRequest(null, "샷 추가",OptionType.OTHER));
|
||||
|
||||
|
||||
ItemOwnerApiController.ItemRequest itemRequest =
|
||||
@@ -257,12 +249,10 @@ class ItemOwnerApiControllerTest {
|
||||
fieldWithPath("requiredOption[*].id").description("옵션 고유번호"),
|
||||
fieldWithPath("requiredOption[*].name").description("옵션 이름"),
|
||||
fieldWithPath("requiredOption[*].optionType").description("옵션 타입"),
|
||||
fieldWithPath("requiredOption[*].price").description("옵션 가격"),
|
||||
fieldWithPath("otherOption").description("추가옵션"),
|
||||
fieldWithPath("otherOption[*].id").description("옵션 고유번호"),
|
||||
fieldWithPath("otherOption[*].name").description("옵션 이름"),
|
||||
fieldWithPath("otherOption[*].optionType").description("옵션 타입"),
|
||||
fieldWithPath("otherOption[*].price").description("옵션 가격")
|
||||
fieldWithPath("otherOption[*].optionType").description("옵션 타입")
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.justpickup.storeservice.domain.store.web;
|
||||
|
||||
import com.justpickup.storeservice.config.TestConfig;
|
||||
import com.justpickup.storeservice.domain.store.dto.StoreDto;
|
||||
import com.justpickup.storeservice.domain.store.service.StoreService;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.ResultActions;
|
||||
|
||||
import static org.mockito.BDDMockito.given;
|
||||
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
|
||||
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
|
||||
import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath;
|
||||
import static org.springframework.restdocs.payload.PayloadDocumentation.responseFields;
|
||||
import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName;
|
||||
import static org.springframework.restdocs.request.RequestDocumentation.pathParameters;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
@WebMvcTest(StoreController.class)
|
||||
@Import(TestConfig.class)
|
||||
@AutoConfigureRestDocs(uriHost = "just-pickup.com", uriPort = 8000)
|
||||
class StoreControllerTest {
|
||||
|
||||
private final String url = "/store";
|
||||
|
||||
@Autowired
|
||||
MockMvc mockMvc;
|
||||
|
||||
@MockBean
|
||||
StoreService storeService;
|
||||
|
||||
@Test
|
||||
@DisplayName("[store] 매장 정보 가져오기")
|
||||
void getStore() throws Exception {
|
||||
//given
|
||||
String storeId = "1";
|
||||
given(storeService.findStore(1L)).willReturn(getWillReturnStore());
|
||||
|
||||
//when
|
||||
ResultActions actions = mockMvc.perform(get("/store/{storeId}", storeId));
|
||||
|
||||
//then
|
||||
actions.andExpect(status().isOk())
|
||||
.andDo(print())
|
||||
.andDo(document("store-get",
|
||||
pathParameters(
|
||||
parameterWithName("storeId").description("매장 고유번호")
|
||||
),
|
||||
responseFields(
|
||||
fieldWithPath("code").description("결과 코드 SUCCESS/ERROR"),
|
||||
fieldWithPath("message").description("메시지"),
|
||||
fieldWithPath("data.id").description("매장 고유번호"),
|
||||
fieldWithPath("data.name").description("매장 이름"),
|
||||
fieldWithPath("data.phoneNumber").description("매장 번호")
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
private StoreDto getWillReturnStore() {
|
||||
return StoreDto.builder().id(1L).name("이디야커피 대림역점").phoneNumber("010-1234-5678").build();
|
||||
}
|
||||
}
|
||||
@@ -93,16 +93,17 @@ class StoreCustomerApiControllerTest {
|
||||
fieldWithPath("message").description("메시지"),
|
||||
fieldWithPath("data[*].id").description("매장 고유번호"),
|
||||
fieldWithPath("data[*].name").description("매장 이름"),
|
||||
fieldWithPath("data[*].distance").description("고객과의 거리차이 m/km")
|
||||
fieldWithPath("data[*].distance").description("고객과의 거리차이 m/km"),
|
||||
fieldWithPath("data[*].favoriteCounts").description("즐겨찾기 회수")
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
private List<SearchStoreResult> getWillReturnSearchStore(){
|
||||
SearchStoreResult result_1 = new SearchStoreResult(1L, "이디야커피 마포오벨리스크점", 145.11980562222007);
|
||||
SearchStoreResult result_2 = new SearchStoreResult(2L, "만랩커피 마포점", 150.97181089895466);
|
||||
SearchStoreResult result_3 = new SearchStoreResult(3L, "커피온리 마포역점", 341.25696860337655);
|
||||
SearchStoreResult result_1 = new SearchStoreResult(1L, "이디야커피 마포오벨리스크점", 145.11980562222007, 5L);
|
||||
SearchStoreResult result_2 = new SearchStoreResult(2L, "만랩커피 마포점", 150.97181089895466, 5L);
|
||||
SearchStoreResult result_3 = new SearchStoreResult(3L, "커피온리 마포역점", 341.25696860337655, 5L);
|
||||
|
||||
return List.of(result_1,result_2,result_3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user