@Test public void testCreate() throws Exception { }
@Override public String create(CartItem cartItem) { RequestEntity<CartItem> requestEntity = new RequestEntity<>(cartItem, HttpMethod.PUT, CREATE_TEMPLATE.expand()); ResponseEntity<String> responseEntity = restTemplate.exchange(requestEntity, String.class); return responseEntity.getBody(); }
CartRepositoryImpl implements CartRepository { @Override public String create(CartItem cartItem) { RequestEntity<CartItem> requestEntity = new RequestEntity<>(cartItem, HttpMethod.PUT, CREATE_TEMPLATE.expand()); ResponseEntity<String> responseEntity = restTemplate.exchange(requestEntity, String.class); return responseEntity.getBody(); } }
CartRepositoryImpl implements CartRepository { @Override public String create(CartItem cartItem) { RequestEntity<CartItem> requestEntity = new RequestEntity<>(cartItem, HttpMethod.PUT, CREATE_TEMPLATE.expand()); ResponseEntity<String> responseEntity = restTemplate.exchange(requestEntity, String.class); return responseEntity.getBody(); } @Autowired  CartRepositoryImpl(@Value("${redis.cart.microservice.url}") String baseUrl,
                              RestTemplate restTemplate); }
CartRepositoryImpl implements CartRepository { @Override public String create(CartItem cartItem) { RequestEntity<CartItem> requestEntity = new RequestEntity<>(cartItem, HttpMethod.PUT, CREATE_TEMPLATE.expand()); ResponseEntity<String> responseEntity = restTemplate.exchange(requestEntity, String.class); return responseEntity.getBody(); } @Autowired  CartRepositoryImpl(@Value("${redis.cart.microservice.url}") String baseUrl,
                              RestTemplate restTemplate); @Override String create(CartItem cartItem); @Override void add(String cartId, CartItem cartItem); @Override void removeFromCart(String cartId, String itemId); @Override void clear(String cartId); @Override List<CartItem> getCartItems(String cartId); }
CartRepositoryImpl implements CartRepository { @Override public String create(CartItem cartItem) { RequestEntity<CartItem> requestEntity = new RequestEntity<>(cartItem, HttpMethod.PUT, CREATE_TEMPLATE.expand()); ResponseEntity<String> responseEntity = restTemplate.exchange(requestEntity, String.class); return responseEntity.getBody(); } @Autowired  CartRepositoryImpl(@Value("${redis.cart.microservice.url}") String baseUrl,
                              RestTemplate restTemplate); @Override String create(CartItem cartItem); @Override void add(String cartId, CartItem cartItem); @Override void removeFromCart(String cartId, String itemId); @Override void clear(String cartId); @Override List<CartItem> getCartItems(String cartId);  }