GITZYY 7 mesi fa
parent
commit
883eaaf153

+ 104 - 0
start/src/test/java/GenerateConfigTest.java

@@ -0,0 +1,104 @@
+import com.alibaba.fastjson2.JSONObject;
+import com.hrsk.cloud.eg.Application;
+import com.hrsk.cloud.eg.infrastructure.business.GenerateCheckIntoHttpApiConfigService;
+import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
+import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @author zhangyy
+ * @version 1.0
+ * @description: GenerateConfigTest
+ * @date 2024/9/9 15:13
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = Application.class)
+public class GenerateConfigTest {
+
+    @Resource
+    private GenerateCheckIntoHttpApiConfigService generateCHeckIntoHttpApiConfigService;
+
+    @Resource
+    private ProductBusinessApiInfoService productBusinessApiInfoService;
+
+    @Test
+    public void createHuiRonApiTest(){
+        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("9");
+        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0));
+        generateCHeckIntoHttpApiConfigService.generateHuiRonHuiRonApiConfig(jsonString);
+    }
+
+    @Test
+    public void createOpenApiRsaTest(){
+        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("1");
+        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0));
+        generateCHeckIntoHttpApiConfigService.generateOpenApiRSAConfig(jsonString);
+    }
+
+
+    @Test
+    public void createQinYuApiTest(){
+        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("4");
+//        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+        generateCHeckIntoHttpApiConfigService.generateQinYuConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+    }
+
+    @Test
+    public void createJinDieApiTest(){
+        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("5");
+//        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+        generateCHeckIntoHttpApiConfigService.generateJinDieConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
+    }
+
+
+    @Test
+    public void createXinLuApiTest(){
+        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("7");
+        generateCHeckIntoHttpApiConfigService.generateXinLuConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
+    }
+
+    @Test
+    public void createXkdApiTest(){
+        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("10");
+        generateCHeckIntoHttpApiConfigService.generateXinLuConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
+    }
+
+
+    @Test
+    public void createRxkApiTest(){
+        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("6");
+        generateCHeckIntoHttpApiConfigService.generateRxkConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+    }
+
+    @Test
+    public void createHuiZhonApiTest(){
+        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Huizhong");
+        generateCHeckIntoHttpApiConfigService.generateHuiZhongConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+    }
+
+    @Test
+    public void createYinHuaApiTest(){
+        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("YinHua");
+        generateCHeckIntoHttpApiConfigService.generateYinHuaConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+    }
+
+    @Test
+    public void createHuiXinApiTest(){
+        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Huixin");
+        generateCHeckIntoHttpApiConfigService.generateHuixinConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
+    }
+
+
+    @Test
+    public void createYuKuaiHuaApiTest(){
+        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("YuKuaiHua");
+        generateCHeckIntoHttpApiConfigService.generateYuKuaiHuaConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
+    }
+
+}

+ 1 - 79
start/src/test/java/StartTest.java → start/src/test/java/StartApiTest.java

@@ -1,13 +1,9 @@
-import com.alibaba.fastjson2.JSONObject;
 import com.hrsk.cloud.eg.Application;
 import com.hrsk.cloud.eg.domain.api.ApiGateway;
-import com.hrsk.cloud.eg.domain.api.KeyValueObject;
-import com.hrsk.cloud.eg.domain.api.resolver.vo.SpelValueObjectResolver;
 import com.hrsk.cloud.eg.dto.data.CheckIntoParamDto;
 import com.hrsk.cloud.eg.dto.data.egPlan.PlanDto;
 import com.hrsk.cloud.eg.dto.data.user.UserInBaseInfoDto;
 import com.hrsk.cloud.eg.infrastructure.business.GenerateCheckIntoHttpApiConfigService;
-import com.hrsk.cloud.eg.infrastructure.repository.database.entity.ProductBusinessApiInfoDo;
 import com.hrsk.cloud.eg.infrastructure.service.EgApiEndpointService;
 import com.hrsk.cloud.eg.infrastructure.service.ProductBusinessApiInfoService;
 import org.junit.Test;
@@ -32,7 +28,7 @@ import java.util.Map;
  */
 @RunWith(SpringRunner.class)
 @SpringBootTest(classes = Application.class)
-public class StartTest {
+public class StartApiTest {
 
     @Resource
     private GenerateCheckIntoHttpApiConfigService generateCHeckIntoHttpApiConfigService;
@@ -45,80 +41,6 @@ public class StartTest {
 
     @Resource
     private ApiGateway apiGateway;
-    @Test
-  public void createHuiRonApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("9");
-        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0));
-        generateCHeckIntoHttpApiConfigService.generateHuiRonHuiRonApiConfig(jsonString);
-  }
-
-    @Test
-    public void createOpenApiRsaTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("1");
-        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0));
-        generateCHeckIntoHttpApiConfigService.generateOpenApiRSAConfig(jsonString);
-    }
-
-
-    @Test
-    public void createQinYuApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("4");
-//        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-        generateCHeckIntoHttpApiConfigService.generateQinYuConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createJinDieApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("5");
-//        String jsonString = JSONObject.toJSONString(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-        generateCHeckIntoHttpApiConfigService.generateJinDieConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
-    }
-
-
-    @Test
-    public void createXinLuApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("7");
-        generateCHeckIntoHttpApiConfigService.generateXinLuConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createXkdApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("10");
-        generateCHeckIntoHttpApiConfigService.generateXinLuConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
-    }
-
-
-    @Test
-    public void createRxkApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointCodeForList("6");
-        generateCHeckIntoHttpApiConfigService.generateRxkConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createHuiZhonApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Huizhong");
-        generateCHeckIntoHttpApiConfigService.generateHuiZhongConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createYinHuaApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("YinHua");
-        generateCHeckIntoHttpApiConfigService.generateYinHuaConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
-    @Test
-    public void createHuiXinApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("Huixin");
-        generateCHeckIntoHttpApiConfigService.generateHuixinConfig(productBusinessApiInfoDos.get(1).getThreeSystemConfig());
-    }
-
-
-    @Test
-    public void createYuKuaiHuaApiTest(){
-        List<ProductBusinessApiInfoDo> productBusinessApiInfoDos = productBusinessApiInfoService.selectByJointJonintTypeForList("YuKuaiHua");
-        generateCHeckIntoHttpApiConfigService.generateYuKuaiHuaConfig(productBusinessApiInfoDos.get(0).getThreeSystemConfig());
-    }
-
 
     @Test
     public void apiHuiRonTest(){