Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a test to verify Action logic and removes the null check, fixes … #684

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public Action add(Action action){
return action;
}

public JsonNode ensureNotNull(@NotNull JsonNode node) {
public JsonNode ensureNotNull(JsonNode node) {
return node == null || node.isNull() || node.isMissingNode() ? JsonNodeFactory.instance.objectNode() : node;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,13 @@ protected void populateDataFromFiles() throws IOException {
assertEquals(1, variables.size());
jsonRequest().body(variables).post("/api/alerting/variables?test=" + t.id).then().statusCode(204);

Action a = new ObjectMapper().readValue(
readFile(p.resolve("new_run_action.json").toFile()), Action.class);
assertEquals("run/new", a.event);
//This request should return a bad request as the url is not set
jsonRequest().auth().oauth2(getAdminToken()).body(a).post("/api/action").then().statusCode(400);


Run r = mapper.readValue(
readFile(p.resolve("roadrunner_run.json").toFile()), Run.class);
assertEquals("dev-team", r.owner);
Expand Down