|
@@ -0,0 +1,29 @@
|
|
|
|
|
+import com.poyee.ProductServiceApplication;
|
|
|
|
|
+import com.poyee.facade.IProductInfoFacade;
|
|
|
|
|
+import com.poyee.req.IdleAttributeReq;
|
|
|
|
|
+import com.poyee.utils.ServletUtils;
|
|
|
|
|
+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;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @author huang_run
|
|
|
|
|
+ * @date 2026/3/20 18:06
|
|
|
|
|
+ */
|
|
|
|
|
+@RunWith(SpringRunner.class)
|
|
|
|
|
+@SpringBootTest(classes = ProductServiceApplication.class)
|
|
|
|
|
+public class ProductApplicationTest {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IProductInfoFacade productInfoFacade;
|
|
|
|
|
+
|
|
|
|
|
+ @Test
|
|
|
|
|
+ public void testBusiness() {
|
|
|
|
|
+// System.err.println(productInfoFacade.idleAttribute("BCd5350a71f15448a5aa"));
|
|
|
|
|
+ ServletUtils.getRequest().setAttribute("X-USER-BASE64","eyJzdWIiOiJhZG1pbl9kZXYiLCJhdWQiOiJwYXJ0bmVyIiwibmJmIjoxNzc0MDAxMTI3LCJyb2xlIjoiYWRtaW4iLCJzdWJhY2NvdW50IjpmYWxzZSwic2NvcGUiOlsib3BlbmlkIiwicHJvZmlsZSJdLCJpc3MiOiJodHRwczovL2F1dGgtZGV2LmhvYmJ5c3RvY2tzLmNuIiwicGFydG5lcl9yb2xlcyI6WyJhZG1pbiIsImltQWRtaW4iLCJpbmRleF9ob21lIl0sImV4cCI6MTc3NDA4NzUyNywiaWF0IjoxNzc0MDAxMTI3LCJ1c2VySWQiOiIxNDEifQ==");
|
|
|
|
|
+ productInfoFacade.idleAttribute(IdleAttributeReq.builder().sku("BCd5350a71f15448a5aa").idleFlag(true).permission(2).build());
|
|
|
|
|
+ }
|
|
|
|
|
+}
|