123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- import com.hrsk.cloud.eg.Application;
- import com.hrsk.cloud.eg.domain.api.ApiGateway;
- 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.service.EgApiEndpointService;
- 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.expression.ExpressionParser;
- import org.springframework.expression.spel.standard.SpelExpressionParser;
- import org.springframework.expression.spel.support.StandardEvaluationContext;
- import org.springframework.test.context.junit4.SpringRunner;
- import javax.annotation.Resource;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * @author zhangyy
- * @version 1.0
- * @description: Test
- * @date 2024/8/28 17:03
- */
- @RunWith(SpringRunner.class)
- @SpringBootTest(classes = Application.class)
- public class StartApiTest {
- @Resource
- private GenerateCheckIntoHttpApiConfigService generateCHeckIntoHttpApiConfigService;
- @Resource
- private ProductBusinessApiInfoService productBusinessApiInfoService;
- @Resource
- private EgApiEndpointService egApiEndpointService;
- @Resource
- private ApiGateway apiGateway;
- @Test
- public void apiHuiRonTest(){
- Long apiId= 441293753667392L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- @Test
- public void openApiRsaTest(){
- Long apiId= 441312253769280L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- user.setCompanyCity("重庆");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- /**
- * @description: 庆鱼暂时不支持解析 !!!
- * @param:
- * @return:
- * @author zhangyy
- * @date: 2024/9/5 11:03
- */
- @Test
- public void qinYuApiRsaTest(){
- Long apiId= 441333216126016L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- user.setCompanyCity("重庆");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- /**
- * @description: 鑫鹿 APi test
- * @param:
- * @return:
- * @author zhangyy
- * @date: 2024/9/5 14:15
- */
- @Test
- public void xinLuApiRsaTest(){
- Long apiId= 441336439865408L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- user.setCompanyCity("重庆");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- /**
- * @description: 享可达 api 测试
- * @param:
- * @return:
- * @author zhangyy
- * @date: 2024/9/5 14:34
- */
- @Test
- public void xkdApiRsaTest(){
- Long apiId= 441336439865408L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- user.setCompanyCity("重庆");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- /**
- * @description: 锦碟V2 api 测试
- * @param:
- * @return:
- * @author zhangyy
- * @date: 2024/9/5 14:34
- */
- @Test
- public void jinDieApiRsaTest(){
- Long apiId= 441425735573312L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- user.setCompanyCity("重庆");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- /**
- * @description: 融享客 api 测试
- * @param:
- * @return:
- * @author zhangyy
- * @date: 2024/9/5 14:34
- */
- @Test
- public void rxkApiTest(){
- Long apiId= 441338278858304L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- user.setCompanyCity("重庆");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- /**
- * @description: 惠众 api 测试
- * @param:
- * @return:
- * @author zhangyy
- * @date: 2024/9/5 14:34
- */
- @Test
- public void huiZhonApiTest(){
- Long apiId= 441421777748032L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- user.setCompanyCity("重庆");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- /**
- * @description: 银华咨询 api 测试
- * @param:
- * @return:
- * @author zhangyy
- * @date: 2024/9/5 14:34
- */
- @Test
- public void huiZhongApiTest(){
- Long apiId= 441425580433728L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- user.setCompanyCity("重庆");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- /**
- * @description: 银华咨询 api 测试
- * @param:
- * @return:
- * @author zhangyy
- * @date: 2024/9/5 14:34
- */
- @Test
- public void yinHuaApiTest(){
- Long apiId= 441425513479232L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- user.setCompanyCity("重庆");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- /**
- * @description:
- * @author zhangyy
- * @date 2024/9/9 11:47
- * @version 1.0
- */
- @Test
- public void huiXinApiTest(){
- Long apiId= 441424531642944L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- user.setCompanyCity("重庆");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- @Test
- public void yuKuaiHuaApiTest(){
- Long apiId= 441424861741888L;
- UserInBaseInfoDto user =new UserInBaseInfoDto();
- user.setPhoneMd5("b5500dfab55f42b340d31326561e16cb");
- user.setCompanyCity("重庆");
- PlanDto plan =new PlanDto();
- plan.setApiId(apiId);
- plan.setBid("aff1c7b30d8b240826030235business");
- CheckIntoParamDto checkin =new CheckIntoParamDto();
- checkin.setPlan(plan);
- checkin.setUser(user);
- apiGateway.checkIntoRequest(checkin);
- }
- @Test
- public void spel(){
- Map<String,Object> map =new HashMap<>();
- map.put("key","1");
- Map<String,Object> map2 =new HashMap<>();
- List<String> list =new ArrayList<>();
- list.add("1");
- list.add("2");
- map2.put("key","3");
- map.put("1",list);
- String spel = "#root['1'][0]";
- ExpressionParser parser = new SpelExpressionParser();
- StandardEvaluationContext context = new StandardEvaluationContext(map);
- // 这里很关键,如果没有配置MapAccessor,那么只能用['c']['a']这种解析方式
- System.out.println(parser.parseExpression(spel).getValue(context));
- }
- }
|