File tree Expand file tree Collapse file tree
src/test/java/com/irum/come2us/domain Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323import java .util .UUID ;
2424import org .junit .jupiter .api .DisplayName ;
2525import org .junit .jupiter .api .Test ;
26+ import org .mockito .Mockito ;
2627import org .springframework .beans .factory .annotation .Autowired ;
2728import org .springframework .boot .test .autoconfigure .restdocs .AutoConfigureRestDocs ;
2829import org .springframework .boot .test .autoconfigure .web .servlet .WebMvcTest ;
30+ import org .springframework .boot .test .context .TestConfiguration ;
31+ import org .springframework .context .annotation .Bean ;
2932import org .springframework .context .annotation .Import ;
3033import org .springframework .http .MediaType ;
3134import org .springframework .restdocs .mockmvc .RestDocumentationRequestBuilders ;
@@ -43,6 +46,14 @@ class CartControllerTest {
4346 private final UUID mockCartId = UUID .randomUUID ();
4447 private final UUID mockOptionValueId = UUID .randomUUID ();
4548
49+ @ TestConfiguration
50+ static class TestConfig {
51+ @ Bean
52+ public CartService cartService () {
53+ return Mockito .mock (CartService .class );
54+ }
55+ }
56+
4657 @ Test
4758 @ DisplayName ("장바구니 추가 API (CUSTOMER)" )
4859 void createCartApiTest () throws Exception {
Original file line number Diff line number Diff line change 2525import org .springframework .beans .factory .annotation .Autowired ;
2626import org .springframework .boot .test .autoconfigure .restdocs .AutoConfigureRestDocs ;
2727import org .springframework .boot .test .autoconfigure .web .servlet .WebMvcTest ;
28+ import org .springframework .boot .test .context .TestConfiguration ;
29+ import org .springframework .context .annotation .Bean ;
2830import org .springframework .context .annotation .Import ;
2931import org .springframework .http .MediaType ;
3032import org .springframework .test .web .servlet .MockMvc ;
@@ -38,6 +40,14 @@ public class OwnerOrderControllerTest {
3840 @ Autowired private ObjectMapper objectMapper ;
3941 @ Autowired private OwnerOrderService ownerOrderService ;
4042
43+ @ TestConfiguration
44+ static class TestConfig {
45+ @ Bean
46+ public OwnerOrderService ownerOrderService () {
47+ return Mockito .mock (OwnerOrderService .class );
48+ }
49+ }
50+
4151 // 배송 준비중
4252 @ Test
4353 @ DisplayName ("[상점] 배송 준비 중 목록 조회 API" )
You can’t perform that action at this time.
0 commit comments