From e19b259bbcad829eac35f2b755ea630813d82c14 Mon Sep 17 00:00:00 2001 From: Kim Hyunsu <38347891+kimhyun5u@users.noreply.github.com> Date: Sun, 18 Aug 2024 00:05:31 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20=EC=A0=84=EC=B2=B4=20=ED=9A=8C?= =?UTF-8?q?=EC=9B=90=20=EC=A1=B0=ED=9A=8C=20(#100)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [test] RetrieveCustomerServiceTest 구현 - RetrieveCustomerServiceTest.testRetrieveAllCustomers: 전체 구매자 조회 테스트 성공 * [feat] RetrieveCustomerService 구현 - RetrieveCustomerService.retrieveAllCustomers: 전체 구매자 조회 로직 * [test] CustomerApiControllerTest 수정 - CustomerApiControllerTest.testRetrieveCustomers: 전체 구매자 조회 테스트 * [feat] CustomerApiController 수정 - CustomerApiController.retrieveAllCustomers: 전체 구매자 조회 요청 처리 * [feat] RetrieveCustomerResponse 구현 * [refactor] VendorApiControllerTest 패키지 수정 * [test] RetrieveVendorServiceTest 구현 - RetrieveVendorServiceTest.testRetrieveVendors: 전체 판매자 조회 테스트 * [test] VendorApiControllerTest 수정 - VendorApiControllerTest.FindVendor: 전체 점주 조회 요청 테스트 * [feat] RetrieveVendorService 구현 - RetrieveVendorService.retrieveVendors: 전체 점주 조회 로직 * [feat] VendorApiController 수정 - VendorApiController.retrieveVendors: 전체 점주 조회 요청 처리 * [feat] RetrieveVendorResponse 구현 * [fix] RetrieveVendorServiceTest 수정 - assertEquals actual 과 expected 정확한 위치로 가도록 수정 * [feat] DTO 구현 - VendorDTO, CustomerDTO, PayAccountDTO * [refactor] DTO 구현에 따른 변경 적용 * [refactor] DTO 외부 종속 제거 - Vendor 와 Customer 가 보여주고 싶은 PayAccount의 정보가 다를 수 있으므로 각 DTO 안에 종속된 PayAccount 정보를 가지도록 수정 --- .../service/RetrieveCustomerService.java | 23 +++++++++ .../lab/customer/service/dto/CustomerDTO.java | 36 ++++++++++++++ .../vendor/service/RetrieveVendorService.java | 23 +++++++++ .../lab/vendor/service/dto/VendorDTO.java | 35 +++++++++++++ .../api/customer/CustomerApiController.java | 14 +++++- .../web/api/vendor/VendorApiController.java | 14 +++++- .../customer/RetrieveCustomerResponse.java | 8 +++ .../vendor/RetrieveVendorResponse.java | 8 +++ .../service/RetrieveCustomerServiceTest.java | 40 +++++++++++++++ .../service/RetrieveVendorServiceTest.java | 40 +++++++++++++++ .../customer/CustomerApiControllerTest.java | 24 ++++++++- .../{ => vendor}/VendorApiControllerTest.java | 49 +++++++++++++++++-- 12 files changed, 308 insertions(+), 6 deletions(-) create mode 100644 src/main/java/camp/woowak/lab/customer/service/RetrieveCustomerService.java create mode 100644 src/main/java/camp/woowak/lab/customer/service/dto/CustomerDTO.java create mode 100644 src/main/java/camp/woowak/lab/vendor/service/RetrieveVendorService.java create mode 100644 src/main/java/camp/woowak/lab/vendor/service/dto/VendorDTO.java create mode 100644 src/main/java/camp/woowak/lab/web/dto/response/customer/RetrieveCustomerResponse.java create mode 100644 src/main/java/camp/woowak/lab/web/dto/response/vendor/RetrieveVendorResponse.java create mode 100644 src/test/java/camp/woowak/lab/customer/service/RetrieveCustomerServiceTest.java create mode 100644 src/test/java/camp/woowak/lab/vendor/service/RetrieveVendorServiceTest.java rename src/test/java/camp/woowak/lab/web/api/{ => vendor}/VendorApiControllerTest.java (91%) diff --git a/src/main/java/camp/woowak/lab/customer/service/RetrieveCustomerService.java b/src/main/java/camp/woowak/lab/customer/service/RetrieveCustomerService.java new file mode 100644 index 00000000..d8ec821b --- /dev/null +++ b/src/main/java/camp/woowak/lab/customer/service/RetrieveCustomerService.java @@ -0,0 +1,23 @@ +package camp.woowak.lab.customer.service; + +import java.util.List; + +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import camp.woowak.lab.customer.repository.CustomerRepository; +import camp.woowak.lab.customer.service.dto.CustomerDTO; + +@Service +@Transactional(readOnly = true) +public class RetrieveCustomerService { + private final CustomerRepository customerRepository; + + public RetrieveCustomerService(CustomerRepository customerRepository) { + this.customerRepository = customerRepository; + } + + public List retrieveAllCustomers() { + return customerRepository.findAll().stream().map(CustomerDTO::new).toList(); + } +} diff --git a/src/main/java/camp/woowak/lab/customer/service/dto/CustomerDTO.java b/src/main/java/camp/woowak/lab/customer/service/dto/CustomerDTO.java new file mode 100644 index 00000000..8af4d323 --- /dev/null +++ b/src/main/java/camp/woowak/lab/customer/service/dto/CustomerDTO.java @@ -0,0 +1,36 @@ +package camp.woowak.lab.customer.service.dto; + +import java.util.UUID; + +import camp.woowak.lab.customer.domain.Customer; +import camp.woowak.lab.payaccount.domain.PayAccount; +import lombok.Getter; + +@Getter +public class CustomerDTO { + private final UUID id; + private final String name; + private final String email; + private final String phone; + private final PayAccountDTO payAccount; + + public CustomerDTO(Customer customer) { + this.id = customer.getId(); + this.name = customer.getName(); + this.email = customer.getEmail(); + this.phone = customer.getPhone(); + this.payAccount = new PayAccountDTO(customer.getPayAccount()); + } + + @Getter + public static class PayAccountDTO { + private final Long id; + private final Long balance; + + public PayAccountDTO(PayAccount payAccount) { + this.id = payAccount.getId(); + this.balance = payAccount.getBalance(); + } + } +} + diff --git a/src/main/java/camp/woowak/lab/vendor/service/RetrieveVendorService.java b/src/main/java/camp/woowak/lab/vendor/service/RetrieveVendorService.java new file mode 100644 index 00000000..2e5b5b27 --- /dev/null +++ b/src/main/java/camp/woowak/lab/vendor/service/RetrieveVendorService.java @@ -0,0 +1,23 @@ +package camp.woowak.lab.vendor.service; + +import java.util.List; + +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import camp.woowak.lab.vendor.repository.VendorRepository; +import camp.woowak.lab.vendor.service.dto.VendorDTO; + +@Service +@Transactional(readOnly = true) +public class RetrieveVendorService { + private final VendorRepository vendorRepository; + + public RetrieveVendorService(VendorRepository vendorRepository) { + this.vendorRepository = vendorRepository; + } + + public List retrieveVendors() { + return vendorRepository.findAll().stream().map(VendorDTO::new).toList(); + } +} diff --git a/src/main/java/camp/woowak/lab/vendor/service/dto/VendorDTO.java b/src/main/java/camp/woowak/lab/vendor/service/dto/VendorDTO.java new file mode 100644 index 00000000..20d0a7e1 --- /dev/null +++ b/src/main/java/camp/woowak/lab/vendor/service/dto/VendorDTO.java @@ -0,0 +1,35 @@ +package camp.woowak.lab.vendor.service.dto; + +import java.util.UUID; + +import camp.woowak.lab.payaccount.domain.PayAccount; +import camp.woowak.lab.vendor.domain.Vendor; +import lombok.Getter; + +@Getter +public class VendorDTO { + private final UUID id; + private final String name; + private final String email; + private final String phone; + private final PayAccountDTO payAccount; + + public VendorDTO(Vendor vendor) { + this.id = vendor.getId(); + this.name = vendor.getName(); + this.email = vendor.getEmail(); + this.phone = vendor.getPhone(); + this.payAccount = new PayAccountDTO(vendor.getPayAccount()); + } + + @Getter + public static class PayAccountDTO { + private final Long id; + private final Long balance; + + public PayAccountDTO(PayAccount payAccount) { + this.id = payAccount.getId(); + this.balance = payAccount.getBalance(); + } + } +} diff --git a/src/main/java/camp/woowak/lab/web/api/customer/CustomerApiController.java b/src/main/java/camp/woowak/lab/web/api/customer/CustomerApiController.java index 58a9f51b..d35bbc97 100644 --- a/src/main/java/camp/woowak/lab/web/api/customer/CustomerApiController.java +++ b/src/main/java/camp/woowak/lab/web/api/customer/CustomerApiController.java @@ -3,11 +3,13 @@ import java.util.UUID; import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import camp.woowak.lab.customer.service.RetrieveCustomerService; import camp.woowak.lab.customer.service.SignInCustomerService; import camp.woowak.lab.customer.service.SignUpCustomerService; import camp.woowak.lab.customer.service.command.SignInCustomerCommand; @@ -15,6 +17,7 @@ import camp.woowak.lab.web.authentication.LoginCustomer; import camp.woowak.lab.web.dto.request.customer.SignInCustomerRequest; import camp.woowak.lab.web.dto.request.customer.SignUpCustomerRequest; +import camp.woowak.lab.web.dto.response.customer.RetrieveCustomerResponse; import camp.woowak.lab.web.dto.response.customer.SignInCustomerResponse; import camp.woowak.lab.web.dto.response.customer.SignUpCustomerResponse; import camp.woowak.lab.web.resolver.session.SessionConst; @@ -26,11 +29,20 @@ public class CustomerApiController { private final SignUpCustomerService signUpCustomerService; private final SignInCustomerService signInCustomerService; + private final RetrieveCustomerService retrieveCustomerService; public CustomerApiController(SignUpCustomerService signUpCustomerService, - SignInCustomerService signInCustomerService) { + SignInCustomerService signInCustomerService, + RetrieveCustomerService retrieveCustomerService) { this.signUpCustomerService = signUpCustomerService; this.signInCustomerService = signInCustomerService; + this.retrieveCustomerService = retrieveCustomerService; + } + + @GetMapping("/customers") + @ResponseStatus(HttpStatus.OK) + public RetrieveCustomerResponse retrieveAllCustomers() { + return new RetrieveCustomerResponse(retrieveCustomerService.retrieveAllCustomers()); } @PostMapping("/customers") diff --git a/src/main/java/camp/woowak/lab/web/api/vendor/VendorApiController.java b/src/main/java/camp/woowak/lab/web/api/vendor/VendorApiController.java index 5f37f6ae..6c148f8f 100644 --- a/src/main/java/camp/woowak/lab/web/api/vendor/VendorApiController.java +++ b/src/main/java/camp/woowak/lab/web/api/vendor/VendorApiController.java @@ -3,11 +3,13 @@ import java.util.UUID; import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import camp.woowak.lab.vendor.service.RetrieveVendorService; import camp.woowak.lab.vendor.service.SignInVendorService; import camp.woowak.lab.vendor.service.SignUpVendorService; import camp.woowak.lab.vendor.service.command.SignInVendorCommand; @@ -15,6 +17,7 @@ import camp.woowak.lab.web.authentication.LoginVendor; import camp.woowak.lab.web.dto.request.vendor.SignInVendorRequest; import camp.woowak.lab.web.dto.request.vendor.SignUpVendorRequest; +import camp.woowak.lab.web.dto.response.vendor.RetrieveVendorResponse; import camp.woowak.lab.web.dto.response.vendor.SignInVendorResponse; import camp.woowak.lab.web.dto.response.vendor.SignUpVendorResponse; import camp.woowak.lab.web.resolver.session.SessionConst; @@ -25,10 +28,19 @@ public class VendorApiController { private final SignUpVendorService signUpVendorService; private final SignInVendorService signInVendorService; + private final RetrieveVendorService retrieveVendorService; - public VendorApiController(SignUpVendorService signUpVendorService, SignInVendorService signInVendorService) { + public VendorApiController(SignUpVendorService signUpVendorService, SignInVendorService signInVendorService, + RetrieveVendorService retrieveVendorService) { this.signUpVendorService = signUpVendorService; this.signInVendorService = signInVendorService; + this.retrieveVendorService = retrieveVendorService; + } + + @GetMapping("/vendors") + @ResponseStatus(HttpStatus.OK) + public RetrieveVendorResponse retrieveVendors() { + return new RetrieveVendorResponse(retrieveVendorService.retrieveVendors()); } @PostMapping("/vendors") diff --git a/src/main/java/camp/woowak/lab/web/dto/response/customer/RetrieveCustomerResponse.java b/src/main/java/camp/woowak/lab/web/dto/response/customer/RetrieveCustomerResponse.java new file mode 100644 index 00000000..6e66d0ec --- /dev/null +++ b/src/main/java/camp/woowak/lab/web/dto/response/customer/RetrieveCustomerResponse.java @@ -0,0 +1,8 @@ +package camp.woowak.lab.web.dto.response.customer; + +import java.util.List; + +import camp.woowak.lab.customer.service.dto.CustomerDTO; + +public record RetrieveCustomerResponse(List customers) { +} diff --git a/src/main/java/camp/woowak/lab/web/dto/response/vendor/RetrieveVendorResponse.java b/src/main/java/camp/woowak/lab/web/dto/response/vendor/RetrieveVendorResponse.java new file mode 100644 index 00000000..ce5fade1 --- /dev/null +++ b/src/main/java/camp/woowak/lab/web/dto/response/vendor/RetrieveVendorResponse.java @@ -0,0 +1,8 @@ +package camp.woowak.lab.web.dto.response.vendor; + +import java.util.List; + +import camp.woowak.lab.vendor.service.dto.VendorDTO; + +public record RetrieveVendorResponse(List vendors) { +} diff --git a/src/test/java/camp/woowak/lab/customer/service/RetrieveCustomerServiceTest.java b/src/test/java/camp/woowak/lab/customer/service/RetrieveCustomerServiceTest.java new file mode 100644 index 00000000..fe035459 --- /dev/null +++ b/src/test/java/camp/woowak/lab/customer/service/RetrieveCustomerServiceTest.java @@ -0,0 +1,40 @@ +package camp.woowak.lab.customer.service; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.BDDMockito.*; + +import java.util.List; +import java.util.UUID; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import camp.woowak.lab.customer.repository.CustomerRepository; +import camp.woowak.lab.customer.service.dto.CustomerDTO; +import camp.woowak.lab.fixture.CustomerFixture; + +@ExtendWith(MockitoExtension.class) +class RetrieveCustomerServiceTest implements CustomerFixture { + @InjectMocks + private RetrieveCustomerService retrieveCustomerService; + + @Mock + private CustomerRepository customerRepository; + + @Test + @DisplayName("전체 Customer 조회 테스트 - 성공") + void testRetrieveAllCustomers() { + // given + given(customerRepository.findAll()).willReturn( + List.of(createCustomer(UUID.randomUUID()), createCustomer(UUID.randomUUID()))); + // when + List result = retrieveCustomerService.retrieveAllCustomers(); + + // then + assertEquals(2, result.size()); + } +} diff --git a/src/test/java/camp/woowak/lab/vendor/service/RetrieveVendorServiceTest.java b/src/test/java/camp/woowak/lab/vendor/service/RetrieveVendorServiceTest.java new file mode 100644 index 00000000..bb11ef45 --- /dev/null +++ b/src/test/java/camp/woowak/lab/vendor/service/RetrieveVendorServiceTest.java @@ -0,0 +1,40 @@ +package camp.woowak.lab.vendor.service; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.BDDMockito.*; + +import java.util.List; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import camp.woowak.lab.fixture.VendorFixture; +import camp.woowak.lab.vendor.repository.VendorRepository; +import camp.woowak.lab.vendor.service.dto.VendorDTO; +import camp.woowak.lab.web.authentication.NoOpPasswordEncoder; + +@ExtendWith(MockitoExtension.class) +class RetrieveVendorServiceTest implements VendorFixture { + @InjectMocks + private RetrieveVendorService retrieveVendorService; + + @Mock + private VendorRepository vendorRepository; + + @Test + @DisplayName("전체 판매자 조회 테스트 - 성공") + void testRetrieveVendors() { + // given + given(vendorRepository.findAll()).willReturn( + List.of(createVendor(createPayAccount(), new NoOpPasswordEncoder()))); + // when + List result = retrieveVendorService.retrieveVendors(); + // then + assertEquals(1, result.size()); + verify(vendorRepository).findAll(); + } +} diff --git a/src/test/java/camp/woowak/lab/web/api/customer/CustomerApiControllerTest.java b/src/test/java/camp/woowak/lab/web/api/customer/CustomerApiControllerTest.java index f7113717..f2f7a7cf 100644 --- a/src/test/java/camp/woowak/lab/web/api/customer/CustomerApiControllerTest.java +++ b/src/test/java/camp/woowak/lab/web/api/customer/CustomerApiControllerTest.java @@ -6,6 +6,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; +import java.util.List; import java.util.UUID; import org.junit.jupiter.api.Assertions; @@ -26,9 +27,12 @@ import camp.woowak.lab.customer.exception.CustomerAuthenticationException; import camp.woowak.lab.customer.exception.CustomerErrorCode; import camp.woowak.lab.customer.exception.DuplicateEmailException; +import camp.woowak.lab.customer.service.RetrieveCustomerService; import camp.woowak.lab.customer.service.SignInCustomerService; import camp.woowak.lab.customer.service.SignUpCustomerService; import camp.woowak.lab.customer.service.command.SignInCustomerCommand; +import camp.woowak.lab.customer.service.dto.CustomerDTO; +import camp.woowak.lab.fixture.CustomerFixture; import camp.woowak.lab.web.authentication.LoginCustomer; import camp.woowak.lab.web.dto.request.customer.SignInCustomerRequest; import camp.woowak.lab.web.dto.request.customer.SignUpCustomerRequest; @@ -37,7 +41,7 @@ @WebMvcTest(CustomerApiController.class) @MockBean(JpaMetamodelMappingContext.class) -class CustomerApiControllerTest { +class CustomerApiControllerTest implements CustomerFixture { @Autowired private MockMvc mockMvc; @@ -48,6 +52,9 @@ class CustomerApiControllerTest { @MockBean private SignInCustomerService signInCustomerService; + @MockBean + private RetrieveCustomerService retrieveCustomerService; + @Autowired private ObjectMapper objectMapper; @@ -274,4 +281,19 @@ void testLoginFail() throws Exception { .andExpect(jsonPath("$.errorCode").value(CustomerErrorCode.AUTHENTICATION_FAILED.getErrorCode())); } + @Test + @DisplayName("전체 구매자 조회 테스트 - 성공") + void testRetrieveCustomers() throws Exception { + // given + given(retrieveCustomerService.retrieveAllCustomers()).willReturn( + List.of(createCustomer(UUID.randomUUID()), createCustomer(UUID.randomUUID())) + .stream() + .map(CustomerDTO::new) + .toList()); + // when & then + mockMvc.perform(get("/customers") + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.data.customers").isArray()); + } } diff --git a/src/test/java/camp/woowak/lab/web/api/VendorApiControllerTest.java b/src/test/java/camp/woowak/lab/web/api/vendor/VendorApiControllerTest.java similarity index 91% rename from src/test/java/camp/woowak/lab/web/api/VendorApiControllerTest.java rename to src/test/java/camp/woowak/lab/web/api/vendor/VendorApiControllerTest.java index 139a6a0e..6ada25a4 100644 --- a/src/test/java/camp/woowak/lab/web/api/VendorApiControllerTest.java +++ b/src/test/java/camp/woowak/lab/web/api/vendor/VendorApiControllerTest.java @@ -1,9 +1,10 @@ -package camp.woowak.lab.web.api; +package camp.woowak.lab.web.api.vendor; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; +import java.util.List; import java.util.UUID; import org.junit.jupiter.api.Assertions; @@ -22,15 +23,19 @@ import com.fasterxml.jackson.databind.ObjectMapper; +import camp.woowak.lab.fixture.VendorFixture; +import camp.woowak.lab.vendor.domain.Vendor; import camp.woowak.lab.vendor.exception.DuplicateEmailException; import camp.woowak.lab.vendor.exception.NotFoundVendorException; import camp.woowak.lab.vendor.exception.PasswordMismatchException; +import camp.woowak.lab.vendor.service.RetrieveVendorService; import camp.woowak.lab.vendor.service.SignInVendorService; import camp.woowak.lab.vendor.service.SignUpVendorService; import camp.woowak.lab.vendor.service.command.SignInVendorCommand; import camp.woowak.lab.vendor.service.command.SignUpVendorCommand; -import camp.woowak.lab.web.api.vendor.VendorApiController; +import camp.woowak.lab.vendor.service.dto.VendorDTO; import camp.woowak.lab.web.authentication.LoginVendor; +import camp.woowak.lab.web.authentication.NoOpPasswordEncoder; import camp.woowak.lab.web.dto.request.vendor.SignInVendorRequest; import camp.woowak.lab.web.dto.request.vendor.SignUpVendorRequest; import camp.woowak.lab.web.resolver.session.SessionConst; @@ -38,13 +43,15 @@ @WebMvcTest(controllers = VendorApiController.class) @MockBean(JpaMetamodelMappingContext.class) -class VendorApiControllerTest { +class VendorApiControllerTest implements VendorFixture { @Autowired private MockMvc mockMvc; @MockBean private SignUpVendorService signUpVendorService; @MockBean private SignInVendorService signInVendorService; + @MockBean + private RetrieveVendorService retrieveVendorService; @Nested @DisplayName("판매자 회원가입: POST /vendors") @@ -478,4 +485,40 @@ void failWithPasswordMismatch() throws Exception { .andDo(print()); } } + + @Nested + @DisplayName("전체 판매자 조회: GET /vendors") + class FindVendor { + @Test + @DisplayName("[성공] 200") + void success() throws Exception { + // given + List vendors = List.of( + createVendor(createPayAccount(), new NoOpPasswordEncoder()), + createVendor(createPayAccount(), new NoOpPasswordEncoder()) + ); + BDDMockito.given(retrieveVendorService.retrieveVendors()) + .willReturn(vendors.stream().map(VendorDTO::new).toList()); + + // when + ResultActions actions = mockMvc.perform( + get("/vendors") + ); + + // then + actions.andExpect(status().isOk()) + .andExpect(jsonPath("$.data.vendors").isArray()) + .andExpect(jsonPath("$.data.vendors.length()").value(vendors.size())); + + for (int i = 0; i < vendors.size(); i++) { + actions + .andExpect(jsonPath("$.data.vendors[" + i + "].name").value(vendors.get(i).getName())) + .andExpect(jsonPath("$.data.vendors[" + i + "].email").value(vendors.get(i).getEmail())) + .andExpect(jsonPath("$.data.vendors[" + i + "].phone").value(vendors.get(i).getPhone())) + .andExpect(jsonPath("$.data.vendors[" + i + "].payAccount.balance") + .value(vendors.get(i).getPayAccount().getBalance())); + } + actions.andDo(print()); + } + } }