Skip to content

Commit

Permalink
fix IT
Browse files Browse the repository at this point in the history
  • Loading branch information
saimu.msm committed Mar 27, 2024
1 parent 010faee commit f0253bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;

import java.util.Date;
import java.util.Map;
import java.util.Stack;
import java.util.function.Supplier;
Expand Down Expand Up @@ -60,10 +61,9 @@ public void test_alarm_block_create() {
@Test
public void test_alarm_block_update() {
AlarmBlockDTO item = new AlarmBlockDTO();
uniqueId = uniqueId + "0";
item.setId(id);
item.setTenant(tenant);
item.setUniqueId(uniqueId);
item.setEndTime(new Date());

given() //
.body(new JSONObject(J.toMap(J.toJson(item)))) //
Expand All @@ -87,7 +87,9 @@ public void test_custom_plugin_delete() {
given() //
.pathParam("id", id) //
.when() //
.delete("/webapi/alarmBlock/delete/{id}").then() //
.delete("/webapi/alarmBlock/delete/{id}") //
.prettyPeek() //
.then() //
.body("success", IS_TRUE) //
.body("data", IS_TRUE); //
Response response = queryById.get();
Expand All @@ -109,6 +111,7 @@ public void test_custom_plugin_pageQuery() {
.body(new JSONObject(J.toMap(J.toJson(item)))) //
.when() //
.post("/webapi/alarmBlock/create") //
.prettyPeek() //
.then() //
.body("success", IS_TRUE) //
.extract() //
Expand All @@ -126,6 +129,7 @@ public void test_custom_plugin_pageQuery() {
.body(new JSONObject(J.toMap(J.toJson(pageRequest)))) //
.when() //
.post("/webapi/alarmBlock/pageQuery") //
.prettyPeek() //
.then() //
.body("success", IS_TRUE) //
.root("data")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public void test_rule_create() {
.body(new JSONObject(J.toMap(J.toJson(alarmRuleDTO)))) //
.when() //
.post("/webapi/alarmRule/create") //
.prettyPeek() //
.then() //
.body("success", IS_TRUE) //
.body("data", Matchers.any(Number.class)) //
Expand Down Expand Up @@ -114,6 +115,7 @@ public void test_triggerContent() {
.body(new JSONObject(J.toMap(J.toJson(alarmRuleDTO)))) //
.when() //
.post("/webapi/alarmRule/create") //
.prettyPeek() //
.then() //
.body("success", IS_TRUE) //
.body("data", Matchers.any(Number.class)) //
Expand Down Expand Up @@ -196,6 +198,7 @@ public void test_rule_update() {
.body(new JSONObject(J.toMap(J.toJson(alarmRuleDTO)))) //
.when() //
.post("/webapi/alarmRule/update") //
.prettyPeek() //
.then() //
.body("success", IS_TRUE) //
.body("data", IS_TRUE);
Expand Down Expand Up @@ -230,6 +233,7 @@ public void test_rule_pageQuery() {
.body(new JSONObject(J.toMap(J.toJson(buildAlarmRule("hit_rule_" + i))))) //
.when() //
.post("/webapi/alarmRule/create") //
.prettyPeek() //
.then() //
.body("success", IS_TRUE) //
.extract() //
Expand All @@ -241,6 +245,7 @@ public void test_rule_pageQuery() {
.body(new JSONObject(J.toMap(J.toJson(buildAlarmRule("miss_rule_" + i))))) //
.when() //
.post("/webapi/alarmRule/create") //
.prettyPeek() //
.then() //
.body("success", IS_TRUE);
}
Expand All @@ -254,6 +259,7 @@ public void test_rule_pageQuery() {
.body(new JSONObject(J.toMap(J.toJson(pageRequest)))) //
.when() //
.post("/webapi/alarmRule/pageQuery") //
.prettyPeek() //
.then() //
.body("success", IS_TRUE) //
.root("data")
Expand All @@ -275,6 +281,7 @@ public void test_alert_calculate() {
.body(new JSONObject(J.toMap(J.toJson(buildAlarmRule("notification"))))) //
.when() //
.post("/webapi/alarmRule/create") //
.prettyPeek() //
.then() //
.body("success", IS_TRUE) //
.body("data", Matchers.any(Number.class)) //
Expand Down Expand Up @@ -311,6 +318,7 @@ public void test_alert_calculate() {
.body(new JSONObject(J.toMap(J.toJson(detailPageRequest)))) //
.when() //
.post("/webapi/alarmHistoryDetail/countTrend") //
.prettyPeek() //
.then() //
.body("success", IS_TRUE) //
.root("data") //
Expand Down

0 comments on commit f0253bf

Please sign in to comment.