test_class.declarator: productService
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private ProductServiceImpl productService;
test_class.type: ProductServiceImpl
test_class.var_name: productService
test_class.file: wechat_order_h/src/test/java/com/hhh/wechat_order/service/impl/ProductServiceImplTest.java
test_class.identifier: ProductServiceImplTest
test_case.body: @Test
      public void onSaleTest(){
          ProductInfo result = productService.onSale("111");
          Assert.assertEquals(ProductStatusEnum.UP , result.getProductStatusEnum());
      }
test_case.class_method_signature: ProductServiceImplTest.onSaleTest()
test_case.full_signature: @Test public void onSaleTest()
test_case.identifier: onSaleTest
test_case.invocations: onSale assertEquals getProductStatusEnum
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void onSaleTest()
focal_class.declarator: repository
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private ProductInfoRepository repository;
focal_class.type: ProductInfoRepository
focal_class.var_name: repository
focal_class.file: wechat_order_h/src/main/java/com/hhh/wechat_order/service/impl/ProductServiceImpl.java
focal_class.identifier: ProductServiceImpl
focal_class.interfaces: implements ProductService
focal_class.class_method_signature: ProductServiceImpl.findById(String productId)
focal_class.full_signature: @Override public Optional<ProductInfo> findById(String productId)
focal_class.identifier: findById
focal_class.modifiers: @Override public
focal_class.parameters: (String productId)
focal_class.return: Optional<ProductInfo>
focal_class.signature: Optional<ProductInfo> findById(String productId)
focal_class.class_method_signature: ProductServiceImpl.findUpAll()
focal_class.full_signature: @Override public List<ProductInfo> findUpAll()
focal_class.identifier: findUpAll
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<ProductInfo>
focal_class.signature: List<ProductInfo> findUpAll()
focal_class.class_method_signature: ProductServiceImpl.findAll(Pageable pageable)
focal_class.full_signature: @Override public Page<ProductInfo> findAll(Pageable pageable)
focal_class.identifier: findAll
focal_class.modifiers: @Override public
focal_class.parameters: (Pageable pageable)
focal_class.return: Page<ProductInfo>
focal_class.signature: Page<ProductInfo> findAll(Pageable pageable)
focal_class.class_method_signature: ProductServiceImpl.findByCategoryType(Integer categoryType)
focal_class.full_signature: @Override public List<ProductInfo> findByCategoryType(Integer categoryType)
focal_class.identifier: findByCategoryType
focal_class.modifiers: @Override public
focal_class.parameters: (Integer categoryType)
focal_class.return: List<ProductInfo>
focal_class.signature: List<ProductInfo> findByCategoryType(Integer categoryType)
focal_class.class_method_signature: ProductServiceImpl.save(ProductInfo productInfo)
focal_class.full_signature: @Override public ProductInfo save(ProductInfo productInfo)
focal_class.identifier: save
focal_class.modifiers: @Override public
focal_class.parameters: (ProductInfo productInfo)
focal_class.return: ProductInfo
focal_class.signature: ProductInfo save(ProductInfo productInfo)
focal_class.class_method_signature: ProductServiceImpl.increaseStock(List<CartDTO> cartDTOList)
focal_class.full_signature: @Override @Transactional public void increaseStock(List<CartDTO> cartDTOList)
focal_class.identifier: increaseStock
focal_class.modifiers: @Override @Transactional public
focal_class.parameters: (List<CartDTO> cartDTOList)
focal_class.return: void
focal_class.signature: void increaseStock(List<CartDTO> cartDTOList)
focal_class.class_method_signature: ProductServiceImpl.decreaseStock(List<CartDTO> cartDTOList)
focal_class.full_signature: @Override @Transactional public void decreaseStock(List<CartDTO> cartDTOList)
focal_class.identifier: decreaseStock
focal_class.modifiers: @Override @Transactional public
focal_class.parameters: (List<CartDTO> cartDTOList)
focal_class.return: void
focal_class.signature: void decreaseStock(List<CartDTO> cartDTOList)
focal_class.class_method_signature: ProductServiceImpl.onSale(String productId)
focal_class.full_signature: @Override public ProductInfo onSale(String productId)
focal_class.identifier: onSale
focal_class.modifiers: @Override public
focal_class.parameters: (String productId)
focal_class.return: ProductInfo
focal_class.signature: ProductInfo onSale(String productId)
focal_class.class_method_signature: ProductServiceImpl.offSale(String productId)
focal_class.full_signature: @Override public ProductInfo offSale(String productId)
focal_class.identifier: offSale
focal_class.modifiers: @Override public
focal_class.parameters: (String productId)
focal_class.return: ProductInfo
focal_class.signature: ProductInfo offSale(String productId)
focal_class.class_method_signature: ProductServiceImpl.delete(String productId)
focal_class.full_signature: @Override public void delete(String productId)
focal_class.identifier: delete
focal_class.modifiers: @Override public
focal_class.parameters: (String productId)
focal_class.return: void
focal_class.signature: void delete(String productId)
focal_method.body: @Override
      public ProductInfo onSale(String productId) {
          Optional<ProductInfo> productInfo = repository.findById(productId);
          if(!productInfo.isPresent()){
              throw new SellException(ResultEnum.PRODUCT_NOT_EXIST);
          }
          if(productInfo.get().getProductStatusEnum() == ProductStatusEnum.UP){
              throw new SellException(ResultEnum.PRODUCT_STATUS_ERROR);
          }
          productInfo.get().setProductStatus(ProductStatusEnum.UP.getCode());
          return repository.save(productInfo.get());
      }
focal_method.class_method_signature: ProductServiceImpl.onSale(String productId)
focal_method.full_signature: @Override public ProductInfo onSale(String productId)
focal_method.identifier: onSale
focal_method.invocations: findById isPresent getProductStatusEnum get setProductStatus get getCode save get
focal_method.modifiers: @Override public
focal_method.parameters: (String productId)
focal_method.return: ProductInfo
focal_method.signature: ProductInfo onSale(String productId)