Skip to content

Commit 089c63d

Browse files
committed
Add the ability to pass a raw event string
1 parent 434ba16 commit 089c63d

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

docs/modules/ROOT/pages/includes/attributes.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
:quarkus-version: 3.11.3
1+
:quarkus-version: 3.13.2
22
:quarkus-github-app-version: 2.6.0
33

44
:github-api-javadoc-root-url: https://github-api.kohsuke.org/apidocs/org/kohsuke/github

testing/src/main/java/io/quarkiverse/githubapp/testing/dsl/EventSenderOptions.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,8 @@ public interface EventSenderOptions {
2121
EventHandlingResponse event(GHEvent event);
2222

2323
EventHandlingResponse event(GHEvent event, boolean ignoreExceptions);
24+
25+
EventHandlingResponse rawEvent(String event);
26+
27+
EventHandlingResponse rawEvent(String event, boolean ignoreExceptions);
2428
}

testing/src/main/java/io/quarkiverse/githubapp/testing/internal/EventSenderOptionsImpl.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,22 @@ public EventHandlingResponseImpl event(GHEvent event) {
8686

8787
@Override
8888
public EventHandlingResponseImpl event(GHEvent event, boolean ignoreExceptions) {
89+
return rawEvent(symbol(event), ignoreExceptions);
90+
}
91+
92+
@Override
93+
public EventHandlingResponseImpl rawEvent(String event) {
94+
return rawEvent(event, false);
95+
}
96+
97+
@Override
98+
public EventHandlingResponseImpl rawEvent(String event, boolean ignoreExceptions) {
8999
HttpRequest request = HttpRequest.newBuilder(buildUrl())
90100
.POST(BodyPublishers.ofString(payload))
91101
.header(Headers.CONTENT_TYPE, contentType)
92102
.header(Headers.X_REQUEST_ID, (requestId == null ? UUID.randomUUID() : requestId).toString())
93103
.header(Headers.X_GITHUB_DELIVERY, (deliveryId == null ? UUID.randomUUID() : deliveryId).toString())
94-
.header(Headers.X_GITHUB_EVENT, symbol(event))
104+
.header(Headers.X_GITHUB_EVENT, event)
95105
.build();
96106

97107
// Only stub these methods when we know they are going to get called;

0 commit comments

Comments
 (0)