潍坊市做网站的公司,ps软件下载电脑版免费怎么下载,微信开发者平台怎么登,wordpress groupon工具引用jar包语言都是beanshell
问题起因#xff1a;metersphere 接口自动化实现过程中#xff0c;如何实现字符串加密且加密方法依赖第三方库#xff1b; 使用语言#xff1a;beanshell脚本语言#xff0c;java语言 使用工具#xff1a;idea jmeter metersphere
1.首…工具引用jar包语言都是beanshell
问题起因metersphere 接口自动化实现过程中如何实现字符串加密且加密方法依赖第三方库 使用语言beanshell脚本语言java语言 使用工具idea jmeter metersphere
1.首先根据开发或者网上给出的加密方法方式 写出代码逻辑
这里开发已经提供了sm2加密的jar包 查看代码
2.将jar包上传到项目设置-文件管理里面 3.查看jar包打开加载jar包开关
4.找对应的接口去进行测试选择beanshell脚本
import com.example.encryption.DemoApplication; //包名.类名DemoApplication d new DemoApplication();
String encryptedString d.encryption(Hello, world!); //调用方法进行传参
log.info(encryptedString);
接口调试可以查看到加密成功
如果遇到报错Error invoking bsh method和 not found in namespace可以看下 查看包是否引用第三方依赖如果有打包的是需要依赖一起打包 pom文件里面配置 plugin artifactIdmaven-assembly-plugin/artifactId configuration !--这部分可有可无,加上的话则直接生成可运行jar包--!--archive--!--manifest--!--mainClass${exec.mainClass}/mainClass--!--/manifest--!--/archive--descriptorRefs descriptorRefjar-with-dependencies/descriptorRef /descriptorRefs /configuration/plugin
jemter 1、添加线程 2.添加http请求添加beanshell前置处理 3.在测试计划里面 引入jar包 4.beanshell脚本里面编写引用方法点击右上角查询日志
可以看到已经引用成功加密成功