|
|
@@ -2,9 +2,11 @@ package com.ruoyi.api;
|
|
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.ruoyi.api.downstream.YzResult;
|
|
|
+import com.ruoyi.api.service.ICategoryService;
|
|
|
import com.ruoyi.api.service.IProductService;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
@@ -15,6 +17,8 @@ import javax.annotation.Resource;
|
|
|
public class ProductsTests {
|
|
|
@Resource
|
|
|
private IProductService productService;
|
|
|
+ @Autowired
|
|
|
+ private ICategoryService categoryService;
|
|
|
|
|
|
@Test
|
|
|
public void testPushProduct() throws JsonProcessingException {
|
|
|
@@ -51,4 +55,16 @@ public class ProductsTests {
|
|
|
YzResult yzResult = productService.deleteProduct();
|
|
|
System.out.println(yzResult);
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testGetProductsList() throws JsonProcessingException{
|
|
|
+ YzResult yzResult = productService.getProductsList();
|
|
|
+ System.out.println(yzResult);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testGetCategory() throws JsonProcessingException{
|
|
|
+ YzResult yzResult = categoryService.getCategoryTree();
|
|
|
+ System.out.println(yzResult);
|
|
|
+ }
|
|
|
}
|