-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
365 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
horreum-api/src/main/java/io/hyperfoil/tools/horreum/api/data/ActionConfig/ActionType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.hyperfoil.tools.horreum.api.data.ActionConfig; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; | ||
import org.eclipse.microprofile.openapi.annotations.media.Schema; | ||
|
||
import java.util.Arrays; | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "Type of Action") | ||
public enum ActionType { | ||
HTTP("http", new TypeReference<HttpActionConfig>() { | ||
}), | ||
GITHUB_ISSUE_COMMENT("github-issue-comment", new TypeReference<GithubIssueCommentActionConfig>() { | ||
}), | ||
GITHUB_ISSUE_CREATE("github-issue-create", new TypeReference<GithubIssueCreateActionConfig>() { | ||
}), | ||
SLACK_MESSAGE("slack-channel-message", new TypeReference<SlackChannelMessageActionConfig>() { | ||
}); | ||
|
||
private static final ActionType[] VALUES = values(); | ||
|
||
private final String name; | ||
private final TypeReference<? extends BaseActionConfig> typeReference; | ||
|
||
private <T extends BaseActionConfig> ActionType(String name, TypeReference<T> typeReference) { | ||
this.typeReference = typeReference; | ||
this.name = name; | ||
} | ||
|
||
public <T extends BaseActionConfig> TypeReference<T> getTypeReference() { | ||
return (TypeReference<T>) typeReference; | ||
} | ||
|
||
@JsonCreator | ||
public static ActionType fromString(String str) { | ||
return Arrays.stream(VALUES).filter(v -> v.name.equals(str)).findAny() | ||
.orElseThrow(() -> new IllegalArgumentException("Unknown action: " + str)); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...-api/src/main/java/io/hyperfoil/tools/horreum/api/data/ActionConfig/BaseActionConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.hyperfoil.tools.horreum.api.data.ActionConfig; | ||
|
||
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; | ||
import org.eclipse.microprofile.openapi.annotations.media.Schema; | ||
|
||
public abstract class BaseActionConfig { | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "Action type") | ||
public String type; | ||
|
||
public BaseActionConfig() { | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...java/io/hyperfoil/tools/horreum/api/data/ActionConfig/GithubIssueCommentActionConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.hyperfoil.tools.horreum.api.data.ActionConfig; | ||
|
||
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; | ||
import org.eclipse.microprofile.openapi.annotations.media.Schema; | ||
|
||
public class GithubIssueCommentActionConfig extends BaseActionConfig { | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "GitHub issue URL") | ||
public String issueUrl; | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "GitHub repo owner") | ||
public String owner; | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "GitHub repo name") | ||
public String repo; | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "GitHub issue number") | ||
public String issue; | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "Object markdown formatter") | ||
public String formatter; | ||
|
||
public GithubIssueCommentActionConfig() { | ||
this.type = ActionType.GITHUB_ISSUE_COMMENT.toString(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
.../java/io/hyperfoil/tools/horreum/api/data/ActionConfig/GithubIssueCreateActionConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.hyperfoil.tools.horreum.api.data.ActionConfig; | ||
|
||
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; | ||
import org.eclipse.microprofile.openapi.annotations.media.Schema; | ||
|
||
public class GithubIssueCreateActionConfig extends BaseActionConfig { | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "GitHub repo owner") | ||
public String owner; | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "GitHub repo name") | ||
public String repo; | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "GitHub issue title") | ||
public String title; | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "Object markdown formatter") | ||
public String formatter; | ||
|
||
public GithubIssueCreateActionConfig() { | ||
this.type = ActionType.GITHUB_ISSUE_CREATE.toString(); | ||
}} |
13 changes: 13 additions & 0 deletions
13
...-api/src/main/java/io/hyperfoil/tools/horreum/api/data/ActionConfig/HttpActionConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.hyperfoil.tools.horreum.api.data.ActionConfig; | ||
|
||
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; | ||
import org.eclipse.microprofile.openapi.annotations.media.Schema; | ||
|
||
public class HttpActionConfig extends BaseActionConfig { | ||
@Schema(type = SchemaType.STRING, required = true, description = "HTTP address") | ||
public String url; | ||
|
||
public HttpActionConfig() { | ||
this.type = ActionType.HTTP.toString(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ava/io/hyperfoil/tools/horreum/api/data/ActionConfig/SlackChannelMessageActionConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.hyperfoil.tools.horreum.api.data.ActionConfig; | ||
|
||
import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; | ||
import org.eclipse.microprofile.openapi.annotations.media.Schema; | ||
|
||
public class SlackChannelMessageActionConfig extends BaseActionConfig { | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "Slack channel") | ||
public String channel; | ||
|
||
@Schema(type = SchemaType.STRING, required = true, description = "Object markdown formatter") | ||
public String formatter; | ||
|
||
public SlackChannelMessageActionConfig() { | ||
this.type = ActionType.SLACK_MESSAGE.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
horreum-integration-tests/src/test/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
quarkus.test.enable-callbacks-for-integration-tests=true | ||
quarkus.http.test-port=8081 |
Oops, something went wrong.