This is an automated email from the ASF dual-hosted git repository. github-actions[bot] pushed a commit to branch camel-main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit 94aeeffa3d88271496dae7d8f2a4cc2d257d6fc8 Author: jiriOndrusek-agent <[email protected]> AuthorDate: Mon Oct 26 08:23:28 2026 +0000 Pass the commit header and file path in the github2 getCommitFile test Since CAMEL-25924 the github2 getCommitFile producer takes the commit from the CamelGitHubCommitSha header, which must be a commit id, and the path of the file from the CamelGitHubFilePath header or the body, and reads the file through the contents API. Send README.adoc with a camel-quarkus commit and stub the contents API instead of the blob. Co-Authored-By: Claude Opus 5.5 <[email protected]> --- .../quarkus/component/github2/it/Github2Resource.java | 10 +++++++--- .../src/test/resources/mappings/github2GetBlob.json | 18 ------------------ .../test/resources/mappings/github2GetFileContent.json | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/integration-tests/github2/src/main/java/org/apache/camel/quarkus/component/github2/it/Github2Resource.java b/integration-tests/github2/src/main/java/org/apache/camel/quarkus/component/github2/it/Github2Resource.java index 8d41e6c2dd..1d1030523f 100644 --- a/integration-tests/github2/src/main/java/org/apache/camel/quarkus/component/github2/it/Github2Resource.java +++ b/integration-tests/github2/src/main/java/org/apache/camel/quarkus/component/github2/it/Github2Resource.java @@ -24,6 +24,7 @@ import jakarta.ws.rs.Path; import jakarta.ws.rs.Produces; import jakarta.ws.rs.core.MediaType; import org.apache.camel.ProducerTemplate; +import org.apache.camel.component.github2.GitHub2Constants; import org.eclipse.microprofile.config.Config; import org.eclipse.microprofile.config.ConfigProvider; import org.kohsuke.github.GHCommit; @@ -34,8 +35,9 @@ import org.kohsuke.github.GitHubBuilder; @Path("/github2") public class Github2Resource { - // Upstream GetCommitFileProducer uses the same SHA for both getCommit() and getBlob() calls private static final String COMMIT_SHA = "6195efafd0a8100795247e35942b5c61fea79267"; + // A camel-quarkus commit at which README.adoc contains "Apache Camel extensions for Quarkus" + private static final String README_COMMIT_SHA = "1893db0c8d823a9b40100cd487e4103531793592"; private static final String GITHUB_AUTH_PARAMS = "oauthToken={{env:GITHUB_TOKEN:}}"; @Inject @@ -52,9 +54,11 @@ public class Github2Resource { uri.append(GITHUB_AUTH_PARAMS); wireMockUrl.ifPresent(url -> uri.append("&apiUrl=").append(url)); - return producerTemplate.requestBody( + return producerTemplate.requestBodyAndHeader( uri.toString(), - COMMIT_SHA, + "README.adoc", + GitHub2Constants.GITHUB_COMMIT_SHA, + README_COMMIT_SHA, String.class); } diff --git a/integration-tests/github2/src/test/resources/mappings/github2GetBlob.json b/integration-tests/github2/src/test/resources/mappings/github2GetBlob.json deleted file mode 100644 index 57d400b97d..0000000000 --- a/integration-tests/github2/src/test/resources/mappings/github2GetBlob.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id" : "a1b2c3d4-aaaa-bbbb-cccc-ddddeeeeffff", - "name" : "repos_apache_camel-quarkus_git_blobs_6195efafd0a8100795247e35942b5c61fea79267", - "request" : { - "url" : "/repos/apache/camel-quarkus/git/blobs/6195efafd0a8100795247e35942b5c61fea79267", - "method" : "GET" - }, - "response" : { - "status" : 200, - "body" : "{\"sha\":\"6195efafd0a8100795247e35942b5c61fea79267\",\"node_id\":\"MDQ6QmxvYjE5MzA2NTM3Njo2MTk1ZWZhZmQwYTgxMDA3OTUyNDdlMzU5NDJiNWM2MWZlYTc5MjY3\",\"size\":520,\"url\":\"https://api.github.com/repos/apache/camel-quarkus/git/blobs/6195efafd0a8100795247e35942b5c61fea79267\",\"content\":\"PSBBcGFjaGUgQ2FtZWwgZXh0ZW5zaW9ucyBmb3IgUXVhcmt1cwoKVGhpcyBwcm9qZWN0IGhvc3RzIHRoZSBlZmZvcnRzIHRvIHBvcnQgYW5kIHBhY2thZ2UgdGhlIDI4MCsgQ2FtZWwgY29tcG9uZW50cyBhcyBRdWFya3VzIGV4dGVuc2lvbnMuCgpodHR [...] - "headers" : { - "Content-Type" : "application/json; charset=utf-8" - } - }, - "uuid" : "a1b2c3d4-aaaa-bbbb-cccc-ddddeeeeffff", - "persistent" : true, - "insertionIndex" : 3 -} diff --git a/integration-tests/github2/src/test/resources/mappings/github2GetFileContent.json b/integration-tests/github2/src/test/resources/mappings/github2GetFileContent.json new file mode 100644 index 0000000000..99c22813b0 --- /dev/null +++ b/integration-tests/github2/src/test/resources/mappings/github2GetFileContent.json @@ -0,0 +1,18 @@ +{ + "id" : "a1b2c3d4-aaaa-bbbb-cccc-ddddeeeeffff", + "name" : "repos_apache_camel-quarkus_contents_readmeadoc", + "request" : { + "url" : "/repos/apache/camel-quarkus/contents/README.adoc?ref=1893db0c8d823a9b40100cd487e4103531793592", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "{\"name\":\"README.adoc\",\"path\":\"README.adoc\",\"sha\":\"6195efafd0a8100795247e35942b5c61fea79267\",\"size\":520,\"url\":\"https://api.github.com/repos/apache/camel-quarkus/contents/README.adoc?ref=1893db0c8d823a9b40100cd487e4103531793592\",\"html_url\":\"https://github.com/apache/camel-quarkus/blob/1893db0c8d823a9b40100cd487e4103531793592/README.adoc\",\"git_url\":\"https://api.github.com/repos/apache/camel-quarkus/git/blobs/6195efafd0a8100795247e35942b5c61fea79267\",\ [...] + "headers" : { + "Content-Type" : "application/json; charset=utf-8" + } + }, + "uuid" : "a1b2c3d4-aaaa-bbbb-cccc-ddddeeeeffff", + "persistent" : true, + "insertionIndex" : 3 +}
