tools.Slack Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of testing-tools Show documentation
Show all versions of testing-tools Show documentation
Tools for supporting automation testing.
package tools;
import io.restassured.RestAssured;
import io.restassured.response.Response;
import org.json.simple.JSONObject;
public class Slack {
private String webHook;
public Slack(String webHook) {
this.webHook = webHook;
}
public Response send(String message) {
RestAssured.baseURI = webHook;
JSONObject data = new JSONObject();
data.put("text", message);
return RestAssured.given()
.header("Content-Type","application/json")
.header("Accept", "application/json")
.body(data.toJSONString())
.post("");
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy