Commit 633fc37f authored by 张艳玲's avatar 张艳玲

修改钉钉推送

parent 06ba160a
......@@ -3,6 +3,14 @@
<component name="CompilerConfiguration">
<annotationProcessing>
<profile default="true" name="Default" enabled="true" />
<profile name="Gradle Imported" enabled="true">
<outputRelativeToContentRoot value="true" />
<processorPath useClasspath="false">
<entry name="$USER_HOME$/Applications/gradle-6.6.1/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.12/48e4e5d60309ebd833bc528dcf77668eab3cd72c/lombok-1.18.12.jar" />
</processorPath>
<module name="kjj.test" />
<module name="kjj.main" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel target="1.8" />
</component>
......
......@@ -5,7 +5,7 @@
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="delegatedBuild" value="true" />
<option name="testRunner" value="GRADLE" />
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="1.8" />
......
......@@ -23,7 +23,10 @@ repositories {
}
dependencies {
implementation 'org.projectlombok:lombok:1.18.16'
compile 'org.projectlombok:lombok:1.18.12'
annotationProcessor 'org.projectlombok:lombok:1.18.12'
testCompile 'org.projectlombok:lombok:1.18.12'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.12'
compile group: 'com.alibaba', name: 'fastjson', version:'1.2.58'
compile(group: 'commons-lang', name: 'commons-lang', version:'2.6') {
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>kjj</groupId>
<artifactId>kjj</artifactId>
<version>1.0-SNAPSHOT</version>
<!-- maven 参数配置,这里引用不同的testng.xml -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- maven 引用依赖不同的jar -->
<dependencies>
<!--导入TestNG依赖包-->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.8</version>
<scope>test</scope>
</dependency>
<!-- 导入fastjson包 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.58</version>
</dependency>
<!-- rest-assured -->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>4.0.0</version>
<scope>test</scope>
</dependency>
<!-- 导入commons-lang的jar包 -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 导入Mysql数据库链接jar包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<!-- 引入poi,解析workbook视图 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<!-- 依赖reportNg 关联testNg-->
<!-- <dependency>-->
<!-- <groupId>org.uncommons</groupId>-->
<!-- <artifactId>reportng</artifactId>-->
<!-- <version>1.1.4</version>-->
<!-- <scope>test</scope>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <groupId>org.testng</groupId>-->
<!-- <artifactId>testng</artifactId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<!-- ExtentReports测试报告 关联testNg-->
<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.0</version>
</dependency>
<dependency>
<groupId>com.vimalselvam</groupId>
<artifactId>testng-extentsreport</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>3.0.6</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>4.2.2</version>
</dependency>
</dependencies>
<!-- 编译插件 -->
<build>
<defaultGoal>compile</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<encoding>utf-8</encoding>
<!--源代码的编译-->
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<suiteXmlFiles>
<suiteXmlFile>src/test/testNG.xml</suiteXmlFile>
</suiteXmlFiles>
<properties>
<!--即使测试失败,也继续下面的测试-->
<property>
<name>usedefaultlisteners</name>
<value>false</value>
</property>
<property>
<name>listener</name>
<value>com.kjj.config.ExtentTestNGIReporterListener</value>
</property>
</properties>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -8,20 +8,5 @@ public class AnswerBean {
private String optionDetail;
private int optionType;
public String getOptionDetail() {
return optionDetail;
}
public void setOptionDetail(String optionDetail) {
this.optionDetail = optionDetail;
}
public int getOptionType() {
return optionType;
}
public void setOptionType(int optionType) {
this.optionType = optionType;
}
}
......@@ -5,11 +5,8 @@ import lombok.Data;
@Data
public class VoteBean {
private String answer;
private String relationResource;
private String relationResourceId;
private int id;
private String name;
private int resourceType;
}
package com.kjj.bean;
import lombok.Data;
import java.util.List;
@Data
public class VoteListBean {
private String answer;
private int relationResourceId;
private VoteBean relationResource;
}
package com.kjj.bean;
import lombok.Data;
@Data
public class WelfareBean {
private int id;
}
package com.kjj.bean;
import lombok.Data;
import java.util.List;
@Data
public class WelfareListBean {
private int totalCount;
private List<WelfareBean> list;
}
......@@ -94,26 +94,24 @@ public class SaveAndUpdate implements AdminAuthorization {
ids.add(291L);
ids.add(292L);
ids.add(293L);
ids.add(294L);
ids.add(295L);
saveOrUpdateParam.put("ids", ids);
Response saveOrUpdateRes = network.postResponse(saveOrUpdateParam, BasicConfig.MANAGER_SAVEORUPDATE);
boolean data2 = saveOrUpdateRes.jsonPath().getBoolean("data");
System.out.println(data2);
Assert.assertTrue(data2, network.message(saveOrUpdateParam, BasicConfig.MANAGER_SAVEORUPDATE, "互动问题配置失败", saveOrUpdateRes.body().asString()));
Assert.assertNotNull(data2, network.message(saveOrUpdateParam, BasicConfig.MANAGER_SAVEORUPDATE, "互动问题配置失败", saveOrUpdateRes.body().asString()));
//投票
Map<String, Object> saveOrUpdate2Param = new HashMap<>();
saveOrUpdate2Param.put("liveId", liveID);
List<Long> ids1 = new ArrayList<>();
ids1.add(227L);
ids1.add(226L);
ids1.add(378L);
ids1.add(380L);
saveOrUpdate2Param.put("ids", ids1);
Response saveOrUpdate2Res = network.postResponse(saveOrUpdateParam, BasicConfig.MANAGER_SAVEORUPDATE2);
boolean data3 = saveOrUpdate2Res.jsonPath().getBoolean("data");
System.out.println(data3);
Assert.assertTrue(data3, network.message(saveOrUpdate2Param, BasicConfig.MANAGER_SAVEORUPDATE2, "投票配置失败", saveOrUpdate2Res.body().asString()));
Assert.assertNotNull(data3, network.message(saveOrUpdate2Param, BasicConfig.MANAGER_SAVEORUPDATE2, "投票配置失败", saveOrUpdate2Res.body().asString()));
//产品资料
Map<String, Object> saveOrUpdate3Param = new HashMap<>();
......@@ -266,6 +264,7 @@ public class SaveAndUpdate implements AdminAuthorization {
Answer.setOptionDetail("选项一");
Answer.setOptionType(1);
Answers.add(Answer);
AnswerBean Answer2 = new AnswerBean();
Answer2.setOptionDetail("选项二");
Answer2.setOptionType(2);
......
......@@ -76,8 +76,33 @@ public class BasicConfig {
//***************直播素材*****************
public static final String MANAGER_SAVEORUPDATE6 = "https://kjj-mng.duibatest.com.cn/kjy/manager/conf/base/welfare/saveOrUpdate";
public static final String MANAGER_SAVEORUPDATE6 = MANAGER_HOST+ "/kjy/manager/conf/base/welfare/saveOrUpdate";
public static final String MANAGER_WELFARELIST = MANAGER_HOST+ "/kjy/manager/conf/base/welfare/list";
public static final String MANAGER_DEL = MANAGER_HOST+ "/kjy/manager/conf/base/welfare/del";
public static final String MANAGER_CHOICE = MANAGER_HOST+ "/kjy/manager/conf/base/choice/saveOrUpdate";
public static final String MANAGER_GETLIST = MANAGER_HOST+ "/kjy/manager/conf/base/choice/getList";
public static final String MANAGER_DELCHOICE= MANAGER_HOST+ "/kjy/manager/conf/base/choice/delChoice";
public static final String MANAGER_LIST1= MANAGER_HOST+ "/kjy/manager/conf/base/question/list";
public static final String MANAGER_DEL1= MANAGER_HOST+ "/kjy/manager/conf/base/question/del";
public static final String MANAGER_QUESTION= MANAGER_HOST+ "/kjy/manager/conf/base/question/saveOrUpdate";
public static final String MANAGER_RESOURCE= MANAGER_HOST+ "/kjy/manager/live/resource/saveOrUpdatePic";
public static final String MANAGER_RESOURCELIST= MANAGER_HOST+ "/kjy/manager/live/resource/list";
public static final String MANAGER_GELRESOURCE= MANAGER_HOST+ "/kjy/manager/live/resource/delResource";
public static final String MANAGER_SAVEORUPDATELINK= MANAGER_HOST+ "/kjy/manager/live/resource/saveOrUpdateLink";
// public static final String MANAGER_SAVEORUPDATELINK= MANAGER_HOST+ "/kjy/manager/live/resource/list";
// *************** 素材ID ***************
......
package com.kjj.utils;
import com.alibaba.fastjson.JSON;
import com.kjj.bean.WelfareListBean;
import groovy.json.JsonBuilder;
import io.restassured.response.Response;
public class JsonUtil {
private JsonUtil() {
}
public static <T> T parseResponseToBean(Response response, Class<T> tClass){
Object data = response.jsonPath().getJsonObject("data");
String str = new JsonBuilder(data).toString();
return JSON.parseObject(str, tClass);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="直播" verbose="1" thread-count="3">
<!-- <test preserve-order="true" name="创建直播">-->
<!-- <classes>-->
<!-- <class name="com.kjj.cases.live.SaveAndUpdate"/>-->
<!-- </classes>-->
<!-- </test>-->
<test preserve-order="true" name="创建直播">
<classes>
<class name="com.kjj.cases.live.SaveAndUpdate"/>
</classes>
</test>
<test preserve-order="true" name="直播素材">
<classes>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment