diff --git a/pom.xml b/pom.xml index c1f613a66..8de2036a9 100644 --- a/pom.xml +++ b/pom.xml @@ -132,6 +132,12 @@ workflow-multibranch test + + org.jenkins-ci.plugins.workflow + workflow-multibranch + tests + test + org.mockito mockito-core diff --git a/src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubApp.java b/src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubApp.java new file mode 100644 index 000000000..37b385448 --- /dev/null +++ b/src/test/java/org/jenkinsci/plugins/github_branch_source/GitHubApp.java @@ -0,0 +1,51 @@ +package org.jenkinsci.plugins.github_branch_source; + +import com.cloudbees.plugins.credentials.CredentialsScope; +import hudson.util.Secret; + +public class GitHubApp { + + // PKCS8 private key (https://stackoverflow.com/a/22176759/4951015) + private static final String PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----\n" + + + // Windows line ending + "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD7vHsVwyDV8cj7\r\n" + + + // This should also work + "5yR4WWl6rlgf/e5zmeBgtm0PCgnitcSbD5FU33301DPY5a7AtqVBOwEnE14L9XS7\r" + + "ov61U+x1m4aQmqR/dPQaA2ayh2cYPszWNQMp42ArDIfg7DhSrvsRJKHsbPXlPjqe\n" + + "c0udLqhSLVIO9frNLf+dAsLsgYk8O39PKGb33akGG7tWTe0J+akNQjgbS7vOi8sS\n" + + "NLwHIdYfz/Am+6Xmm+J4yVs6+Xt3kOeLdFBkz8H/HGsJq854MbIAK/HuId1MOPS0\n" + + "cDWh37tzRsM+q/HZzYRkc5bhNKw/Mj9jN9jD5GH0Lfea0QFedjppf1KvWdcXn+/W\n" + + "M7OmyfhvAgMBAAECggEAN96H7reExRbJRWbySCeH6mthMZB46H0hODWklK7krMUs\n" + + "okFdPtnvKXQjIaMwGqMuoACJa/O3bq4GP1KYdwPuOdfPkK5RjdwWBOP2We8FKXNe\n" + + "oLfZQOWuxT8dtQSYJ3mgTRi1OzSfikY6Wko6YOMnBj36tUlQZVMtJNqlCjphi9Uz\n" + + "6EyvRURlDG8sBBbC7ods5B0789qk3iGH/97ia+1QIqXAUaVFg3/BA6wkxkbNG2sN\n" + + "tqULgVYTw32Oj/Y/H1Y250RoocTyfsUS3I3aPIlnvcgp2bugWqDyYJ58nDIt3Pku\n" + + "fjImWrNz/pNiEs+efnb0QEk7m5hYwxmyXN4KRSv0OQKBgQD+I3Y3iNKSVr6wXjur\n" + + "OPp45fxS2sEf5FyFYOn3u760sdJOH9fGlmf9sDozJ8Y8KCaQCN5tSe3OM+XDrmiw\n" + + "Cu/oaqJ1+G4RG+6w1RJF+5Nfg6PkUs7eJehUgZ2Tox8Tg1mfVIV8KbMwNi5tXpug\n" + + "MVmA2k9xjc4uMd2jSnSj9NAqrQKBgQD9lIO1tY6YKF0Eb0Qi/iLN4UqBdJfnALBR\n" + + "MjxYxqqI8G4wZEoZEJJvT1Lm6Q3o577N95SihZoj69tb10vvbEz1pb3df7c1HEku\n" + + "LXcyVMvjR/CZ7dOSNgLGAkFfOoPhcF/OjSm4DrGPe3GiBxhwXTBjwJ5TIgEDkVIx\n" + + "ZVo5r7gPCwKBgQCOvsZo/Q4hql2jXNqxGuj9PVkUBNFTI4agWEYyox7ECdlxjks5\n" + + "vUOd5/1YvG+JXJgEcSbWRh8volDdL7qXnx0P881a6/aO35ybcKK58kvd62gEGEsf\n" + + "1jUAOmmTAp2y7SVK7EOp8RY370b2oZxSR0XZrUXQJ3F22wV98ZVAfoLqZQKBgDIr\n" + + "PdunbezAn5aPBOX/bZdZ6UmvbZYwVrHZxIKz2214U/STAu3uj2oiQX6ZwTzBDMjn\n" + + "IKr+z74nnaCP+eAGhztabTPzXqXNUNUn/Zshl60BwKJToTYeJXJTY+eZRhpGB05w\n" + + "Mz7M+Wgvvg2WZcllRnuV0j0UTysLhz1qle0vzLR9AoGBAOukkFFm2RLm9N1P3gI8\n" + + "mUadeAlYRZ5o0MvumOHaB5pDOCKhrqAhop2gnM0f5uSlapCtlhj0Js7ZyS3Giezg\n" + + "38oqAhAYxy2LMoLD7UtsHXNp0OnZ22djcDwh+Wp2YORm7h71yOM0NsYubGbp+CmT\n" + + "Nw9bewRvqjySBlDJ9/aNSeEY\n" + + "-----END PRIVATE KEY-----"; + + public static GitHubAppCredentials createCredentials(final String id) { + return new GitHubAppCredentials(CredentialsScope.GLOBAL, id, "sample", "54321", Secret.fromString(PRIVATE_KEY)); + } + + public static GitHubAppCredentials createCredentials(final String id, final String owner) { + final var credentials = createCredentials(id); + credentials.setOwner(owner); + return credentials; + } +} diff --git a/src/test/java/org/jenkinsci/plugins/github_branch_source/GithubAppCredentialsContextualizationTest.java b/src/test/java/org/jenkinsci/plugins/github_branch_source/GithubAppCredentialsContextualizationTest.java new file mode 100644 index 000000000..221d11da4 --- /dev/null +++ b/src/test/java/org/jenkinsci/plugins/github_branch_source/GithubAppCredentialsContextualizationTest.java @@ -0,0 +1,90 @@ +package org.jenkinsci.plugins.github_branch_source; + +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.notNullValue; + +import com.cloudbees.plugins.credentials.CredentialsProvider; +import com.cloudbees.plugins.credentials.domains.Domain; +import hudson.model.Cause; +import java.time.Duration; +import java.time.Instant; +import java.time.format.DateTimeFormatter; +import java.time.temporal.ChronoUnit; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import jenkins.branch.BranchSource; +import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject; +import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProjectTest; +import org.junit.Before; +import org.junit.Test; + +public class GithubAppCredentialsContextualizationTest extends AbstractGitHubWireMockTest { + + @Before + public void setUpWireMock() throws Exception { + GitHubConfiguration.get().setApiRateLimitChecker(ApiRateLimitChecker.ThrottleOnOver); + + // Add wiremock responses for App, App Installation, and App Installation Token + githubApi.stubFor(get(urlEqualTo("/app")) + .willReturn(aResponse() + .withHeader("Content-Type", "application/json; charset=utf-8") + .withBodyFile("../AppCredentials/files/body-mapping-githubapp-app.json"))); + githubApi.stubFor(get(urlEqualTo("/app/installations")) + .willReturn(aResponse() + .withHeader("Content-Type", "application/json; charset=utf-8") + .withBodyFile("../AppCredentials/files/body-mapping-githubapp-installations.json"))); + githubApi.stubFor(post(urlEqualTo("/app/installations/654321/access_tokens")) + .withRequestBody(equalToJson( + "{\"permissions\":{\"pull_requests\":\"write\",\"metadata\":\"read\",\"checks\":\"write\",\"contents\":\"read\"}}", + true, + false)) + .willReturn(aResponse() + .withHeader("Content-Type", "application/json; charset=utf-8") + .withBody("{\n" + + " \"token\": \"super-secret-token\",\n" + + + // This token will go stale at the soonest allowed time but will not + // expire for the duration of the test + " \"expires_at\": \"" + + printDate(new Date(System.currentTimeMillis() + + Duration.ofMinutes(10).toMillis())) + + "\"" + + // 2019-08-10T05:54:58Z + "}"))); + } + + @Test + public void ownerMustBeInferedFromRepository() throws Exception { + final var store = CredentialsProvider.lookupStores(r.jenkins).iterator().next(); + + final var credentials = GitHubApp.createCredentials("myAppCredentialsWithoutOwner"); + store.addCredentials(Domain.global(), credentials); + credentials.setApiUri(githubApi.baseUrl()); + + final var scmSource = new GitHubSCMSource("cloudbeers", "multibranch-demo", null, false); + scmSource.setTraits(Arrays.asList(new BranchDiscoveryTrait(true, true))); + scmSource.setCredentialsId(credentials.getId()); + scmSource.setApiUri(githubApi.baseUrl()); + + final var multiBranchProject = r.jenkins.createProject(WorkflowMultiBranchProject.class, "multibranch-demo"); + multiBranchProject.setSourcesList(Collections.singletonList(new BranchSource(scmSource))); + multiBranchProject.scheduleBuild(new Cause.UserIdCause()); + + r.waitUntilNoActivity(); + + final var branchProject = + WorkflowMultiBranchProjectTest.scheduleAndFindBranchProject(multiBranchProject, "master"); + assertThat(branchProject, notNullValue()); + } + + static String printDate(Date dt) { + return DateTimeFormatter.ISO_INSTANT.format( + Instant.ofEpochMilli(dt.getTime()).truncatedTo(ChronoUnit.SECONDS)); + } +} diff --git a/src/test/java/org/jenkinsci/plugins/github_branch_source/GithubAppCredentialsTest.java b/src/test/java/org/jenkinsci/plugins/github_branch_source/GithubAppCredentialsTest.java index cccff5254..f71b3d401 100644 --- a/src/test/java/org/jenkinsci/plugins/github_branch_source/GithubAppCredentialsTest.java +++ b/src/test/java/org/jenkinsci/plugins/github_branch_source/GithubAppCredentialsTest.java @@ -8,7 +8,6 @@ import static org.junit.Assert.assertThrows; import com.cloudbees.plugins.credentials.CredentialsProvider; -import com.cloudbees.plugins.credentials.CredentialsScope; import com.cloudbees.plugins.credentials.CredentialsStore; import com.cloudbees.plugins.credentials.domains.Domain; import com.github.tomakehurst.wiremock.http.RequestMethod; @@ -20,7 +19,6 @@ import hudson.model.Result; import hudson.model.Slave; import hudson.model.StringParameterDefinition; -import hudson.util.Secret; import java.time.Duration; import java.time.Instant; import java.time.format.DateTimeFormatter; @@ -57,40 +55,6 @@ public class GithubAppCredentialsTest extends AbstractGitHubWireMockTest { private static GitHubAppCredentials appCredentials, appCredentialsNoOwner; private static LogRecorder logRecorder; - // https://stackoverflow.com/a/22176759/4951015 - public static final String PKCS8_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----\n" - + - // Windows line ending - "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD7vHsVwyDV8cj7\r\n" - + - // This should also work - "5yR4WWl6rlgf/e5zmeBgtm0PCgnitcSbD5FU33301DPY5a7AtqVBOwEnE14L9XS7\r" - + "ov61U+x1m4aQmqR/dPQaA2ayh2cYPszWNQMp42ArDIfg7DhSrvsRJKHsbPXlPjqe\n" - + "c0udLqhSLVIO9frNLf+dAsLsgYk8O39PKGb33akGG7tWTe0J+akNQjgbS7vOi8sS\n" - + "NLwHIdYfz/Am+6Xmm+J4yVs6+Xt3kOeLdFBkz8H/HGsJq854MbIAK/HuId1MOPS0\n" - + "cDWh37tzRsM+q/HZzYRkc5bhNKw/Mj9jN9jD5GH0Lfea0QFedjppf1KvWdcXn+/W\n" - + "M7OmyfhvAgMBAAECggEAN96H7reExRbJRWbySCeH6mthMZB46H0hODWklK7krMUs\n" - + "okFdPtnvKXQjIaMwGqMuoACJa/O3bq4GP1KYdwPuOdfPkK5RjdwWBOP2We8FKXNe\n" - + "oLfZQOWuxT8dtQSYJ3mgTRi1OzSfikY6Wko6YOMnBj36tUlQZVMtJNqlCjphi9Uz\n" - + "6EyvRURlDG8sBBbC7ods5B0789qk3iGH/97ia+1QIqXAUaVFg3/BA6wkxkbNG2sN\n" - + "tqULgVYTw32Oj/Y/H1Y250RoocTyfsUS3I3aPIlnvcgp2bugWqDyYJ58nDIt3Pku\n" - + "fjImWrNz/pNiEs+efnb0QEk7m5hYwxmyXN4KRSv0OQKBgQD+I3Y3iNKSVr6wXjur\n" - + "OPp45fxS2sEf5FyFYOn3u760sdJOH9fGlmf9sDozJ8Y8KCaQCN5tSe3OM+XDrmiw\n" - + "Cu/oaqJ1+G4RG+6w1RJF+5Nfg6PkUs7eJehUgZ2Tox8Tg1mfVIV8KbMwNi5tXpug\n" - + "MVmA2k9xjc4uMd2jSnSj9NAqrQKBgQD9lIO1tY6YKF0Eb0Qi/iLN4UqBdJfnALBR\n" - + "MjxYxqqI8G4wZEoZEJJvT1Lm6Q3o577N95SihZoj69tb10vvbEz1pb3df7c1HEku\n" - + "LXcyVMvjR/CZ7dOSNgLGAkFfOoPhcF/OjSm4DrGPe3GiBxhwXTBjwJ5TIgEDkVIx\n" - + "ZVo5r7gPCwKBgQCOvsZo/Q4hql2jXNqxGuj9PVkUBNFTI4agWEYyox7ECdlxjks5\n" - + "vUOd5/1YvG+JXJgEcSbWRh8volDdL7qXnx0P881a6/aO35ybcKK58kvd62gEGEsf\n" - + "1jUAOmmTAp2y7SVK7EOp8RY370b2oZxSR0XZrUXQJ3F22wV98ZVAfoLqZQKBgDIr\n" - + "PdunbezAn5aPBOX/bZdZ6UmvbZYwVrHZxIKz2214U/STAu3uj2oiQX6ZwTzBDMjn\n" - + "IKr+z74nnaCP+eAGhztabTPzXqXNUNUn/Zshl60BwKJToTYeJXJTY+eZRhpGB05w\n" - + "Mz7M+Wgvvg2WZcllRnuV0j0UTysLhz1qle0vzLR9AoGBAOukkFFm2RLm9N1P3gI8\n" - + "mUadeAlYRZ5o0MvumOHaB5pDOCKhrqAhop2gnM0f5uSlapCtlhj0Js7ZyS3Giezg\n" - + "38oqAhAYxy2LMoLD7UtsHXNp0OnZ22djcDwh+Wp2YORm7h71yOM0NsYubGbp+CmT\n" - + "Nw9bewRvqjySBlDJ9/aNSeEY\n" - + "-----END PRIVATE KEY-----"; - @Rule public GitSampleRepoRule sampleRepo = new GitSampleRepoRule(); @@ -107,16 +71,9 @@ public static void setUpJenkins() throws Exception { // Add credential (Must have valid private key for Jwt to work, but App doesn't have to actually // exist) store = CredentialsProvider.lookupStores(r.jenkins).iterator().next(); - appCredentials = new GitHubAppCredentials( - CredentialsScope.GLOBAL, myAppCredentialsId, "sample", "54321", Secret.fromString(PKCS8_PRIVATE_KEY)); - appCredentials.setOwner("cloudBeers"); + appCredentials = GitHubApp.createCredentials(myAppCredentialsId, "cloudBeers"); store.addCredentials(Domain.global(), appCredentials); - appCredentialsNoOwner = new GitHubAppCredentials( - CredentialsScope.GLOBAL, - myAppCredentialsNoOwnerId, - "sample", - "54321", - Secret.fromString(PKCS8_PRIVATE_KEY)); + appCredentialsNoOwner = GitHubApp.createCredentials(myAppCredentialsNoOwnerId); store.addCredentials(Domain.global(), appCredentialsNoOwner); // Add agent @@ -506,13 +463,6 @@ public void testPassword() throws Exception { } } - @Test - public void testWithOwner() { - final var appCredentialsWithOwner = appCredentialsNoOwner.withOwner("cloudBeers"); - assertThat(appCredentialsNoOwner.getOwner(), is(nullValue())); - assertThat(appCredentialsWithOwner.getOwner(), equalTo("cloudBeers")); - } - private List getOutputLines() { final Formatter formatter = new SimpleFormatter(); List result = new ArrayList<>(logRecorder.getLogRecords()); diff --git a/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo-branches.json b/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo-branches.json new file mode 100644 index 000000000..2fe28b544 --- /dev/null +++ b/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo-branches.json @@ -0,0 +1,10 @@ +[ + { + "name": "master", + "commit": { + "sha": "ba1fdaa6c2088cecea85333e763710cd3f39688f", + "url": "https://api.github.com/repos/cloudbeers/multibranch-demo/commits/ba1fdaa6c2088cecea85333e763710cd3f39688f" + }, + "protected": false + } +] \ No newline at end of file diff --git a/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo-contents.json b/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo-contents.json new file mode 100644 index 000000000..3212fcabf --- /dev/null +++ b/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo-contents.json @@ -0,0 +1,50 @@ +[ + { + "name": "Jenkinsfile", + "path": "Jenkinsfile", + "sha": "98c0f1dad6a7874ff6a7ccc4dd72a5519ec8fdba", + "size": 351, + "url": "https://api.github.com/repos/cloudbeers/multibranch-demo/contents/Jenkinsfile?ref=refs/heads/master", + "html_url": "https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/Jenkinsfile", + "git_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/98c0f1dad6a7874ff6a7ccc4dd72a5519ec8fdba", + "download_url": "https://raw.githubusercontent.com/cloudbeers/multibranch-demo/refs/heads/master/Jenkinsfile", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/cloudbeers/multibranch-demo/contents/Jenkinsfile?ref=refs/heads/master", + "git": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/98c0f1dad6a7874ff6a7ccc4dd72a5519ec8fdba", + "html": "https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/Jenkinsfile" + } + }, + { + "name": "README.md", + "path": "README.md", + "sha": "59e16b0d408539ab4f23d64f2cafd33495eb21ad", + "size": 131, + "url": "https://api.github.com/repos/cloudbeers/multibranch-demo/contents/README.md?ref=refs/heads/master", + "html_url": "https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/README.md", + "git_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/59e16b0d408539ab4f23d64f2cafd33495eb21ad", + "download_url": "https://raw.githubusercontent.com/cloudbeers/multibranch-demo/refs/heads/master/README.md", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/cloudbeers/multibranch-demo/contents/README.md?ref=refs/heads/master", + "git": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/59e16b0d408539ab4f23d64f2cafd33495eb21ad", + "html": "https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/README.md" + } + }, + { + "name": "hello-world.go", + "path": "hello-world.go", + "sha": "b64817ed596a1dae19dfa3f8a6e6bc26506cc645", + "size": 75, + "url": "https://api.github.com/repos/cloudbeers/multibranch-demo/contents/hello-world.go?ref=refs/heads/master", + "html_url": "https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/hello-world.go", + "git_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/b64817ed596a1dae19dfa3f8a6e6bc26506cc645", + "download_url": "https://raw.githubusercontent.com/cloudbeers/multibranch-demo/refs/heads/master/hello-world.go", + "type": "file", + "_links": { + "self": "https://api.github.com/repos/cloudbeers/multibranch-demo/contents/hello-world.go?ref=refs/heads/master", + "git": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/b64817ed596a1dae19dfa3f8a6e6bc26506cc645", + "html": "https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/hello-world.go" + } + } +] \ No newline at end of file diff --git a/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo-pulls.json b/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo-pulls.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo-pulls.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo.json b/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo.json new file mode 100644 index 000000000..e3427456b --- /dev/null +++ b/src/test/resources/api/__files/body-repos-cloudbeers-multibranch-demo.json @@ -0,0 +1,310 @@ +{ + "id": 863392439, + "node_id": "R_kgDOM3ZStw", + "name": "multibranch-demo", + "full_name": "cloudbeers/multibranch-demo", + "private": false, + "owner": { + "login": "cloudbeers", + "id": 814127, + "node_id": "MDQ6VXNlcjgxNDEyNw==", + "avatar_url": "https://avatars.githubusercontent.com/u/4181899?v=3", + "gravatar_id": "", + "url": "https://api.github.com/users/cloudbeers", + "html_url": "https://github.com/cloudbeers", + "followers_url": "https://api.github.com/users/cloudbeers/followers", + "following_url": "https://api.github.com/users/cloudbeers/following{/other_user}", + "gists_url": "https://api.github.com/users/cloudbeers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/cloudbeers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/cloudbeers/subscriptions", + "organizations_url": "https://api.github.com/users/cloudbeers/orgs", + "repos_url": "https://api.github.com/users/cloudbeers/repos", + "events_url": "https://api.github.com/users/cloudbeers/events{/privacy}", + "received_events_url": "https://api.github.com/users/cloudbeers/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/cloudbeers/multibranch-demo", + "description": "Simple demonstration of how to use multibranch pipelines", + "fork": true, + "url": "https://api.github.com/repos/cloudbeers/multibranch-demo", + "forks_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/forks", + "keys_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/teams", + "hooks_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/hooks", + "issue_events_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/issues/events{/number}", + "events_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/events", + "assignees_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/assignees{/user}", + "branches_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/branches{/branch}", + "tags_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/tags", + "blobs_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/languages", + "stargazers_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/stargazers", + "contributors_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/contributors", + "subscribers_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/subscribers", + "subscription_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/subscription", + "commits_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/contents/{+path}", + "compare_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/merges", + "archive_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/downloads", + "issues_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/issues{/number}", + "pulls_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/labels{/name}", + "releases_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/releases{/id}", + "deployments_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/deployments", + "created_at": "2024-09-26T08:09:07Z", + "updated_at": "2024-09-26T08:09:07Z", + "pushed_at": "2023-11-15T06:52:14Z", + "git_url": "git://github.com/cloudbeers/multibranch-demo.git", + "ssh_url": "git@github.com:cloudbeers/multibranch-demo.git", + "clone_url": "https://github.com/cloudbeers/multibranch-demo.git", + "svn_url": "https://github.com/cloudbeers/multibranch-demo", + "homepage": "", + "size": 16, + "stargazers_count": 0, + "watchers_count": 0, + "language": null, + "has_issues": false, + "has_projects": true, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": false, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "master", + "permissions": { + "admin": false, + "maintain": false, + "push": false, + "triage": false, + "pull": false + }, + "temp_clone_token": "", + "parent": { + "id": 41513585, + "node_id": "MDEwOlJlcG9zaXRvcnk0MTUxMzU4NQ==", + "name": "multibranch-demo", + "full_name": "cloudbeers/multibranch-demo", + "private": false, + "owner": { + "login": "cloudbeers", + "id": 4181899, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjQxODE4OTk=", + "avatar_url": "https://avatars.githubusercontent.com/u/4181899?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/cloudbeers", + "html_url": "https://github.com/cloudbeers", + "followers_url": "https://api.github.com/users/cloudbeers/followers", + "following_url": "https://api.github.com/users/cloudbeers/following{/other_user}", + "gists_url": "https://api.github.com/users/cloudbeers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/cloudbeers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/cloudbeers/subscriptions", + "organizations_url": "https://api.github.com/users/cloudbeers/orgs", + "repos_url": "https://api.github.com/users/cloudbeers/repos", + "events_url": "https://api.github.com/users/cloudbeers/events{/privacy}", + "received_events_url": "https://api.github.com/users/cloudbeers/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/cloudbeers/multibranch-demo", + "description": "Simple demonstration of how to use multibranch pipelines", + "fork": false, + "url": "https://api.github.com/repos/cloudbeers/multibranch-demo", + "forks_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/forks", + "keys_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/teams", + "hooks_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/hooks", + "issue_events_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/issues/events{/number}", + "events_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/events", + "assignees_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/assignees{/user}", + "branches_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/branches{/branch}", + "tags_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/tags", + "blobs_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/languages", + "stargazers_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/stargazers", + "contributors_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/contributors", + "subscribers_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/subscribers", + "subscription_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/subscription", + "commits_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/contents/{+path}", + "compare_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/merges", + "archive_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/downloads", + "issues_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/issues{/number}", + "pulls_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/labels{/name}", + "releases_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/releases{/id}", + "deployments_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/deployments", + "created_at": "2015-08-27T22:02:12Z", + "updated_at": "2023-08-23T06:28:13Z", + "pushed_at": "2023-11-15T06:52:14Z", + "git_url": "git://github.com/cloudbeers/multibranch-demo.git", + "ssh_url": "git@github.com:cloudbeers/multibranch-demo.git", + "clone_url": "https://github.com/cloudbeers/multibranch-demo.git", + "svn_url": "https://github.com/cloudbeers/multibranch-demo", + "homepage": "", + "size": 16, + "stargazers_count": 16, + "watchers_count": 16, + "language": "Go", + "has_issues": false, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": false, + "forks_count": 289, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 12, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 289, + "open_issues": 12, + "watchers": 16, + "default_branch": "master" + }, + "source": { + "id": 41513585, + "node_id": "MDEwOlJlcG9zaXRvcnk0MTUxMzU4NQ==", + "name": "multibranch-demo", + "full_name": "cloudbeers/multibranch-demo", + "private": false, + "owner": { + "login": "cloudbeers", + "id": 4181899, + "node_id": "MDEyOk9yZ2FuaXphdGlvbjQxODE4OTk=", + "avatar_url": "https://avatars.githubusercontent.com/u/4181899?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/cloudbeers", + "html_url": "https://github.com/cloudbeers", + "followers_url": "https://api.github.com/users/cloudbeers/followers", + "following_url": "https://api.github.com/users/cloudbeers/following{/other_user}", + "gists_url": "https://api.github.com/users/cloudbeers/gists{/gist_id}", + "starred_url": "https://api.github.com/users/cloudbeers/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/cloudbeers/subscriptions", + "organizations_url": "https://api.github.com/users/cloudbeers/orgs", + "repos_url": "https://api.github.com/users/cloudbeers/repos", + "events_url": "https://api.github.com/users/cloudbeers/events{/privacy}", + "received_events_url": "https://api.github.com/users/cloudbeers/received_events", + "type": "Organization", + "site_admin": false + }, + "html_url": "https://github.com/cloudbeers/multibranch-demo", + "description": "Simple demonstration of how to use multibranch pipelines", + "fork": false, + "url": "https://api.github.com/repos/cloudbeers/multibranch-demo", + "forks_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/forks", + "keys_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/teams", + "hooks_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/hooks", + "issue_events_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/issues/events{/number}", + "events_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/events", + "assignees_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/assignees{/user}", + "branches_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/branches{/branch}", + "tags_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/tags", + "blobs_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/statuses/{sha}", + "languages_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/languages", + "stargazers_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/stargazers", + "contributors_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/contributors", + "subscribers_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/subscribers", + "subscription_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/subscription", + "commits_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/contents/{+path}", + "compare_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/merges", + "archive_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/downloads", + "issues_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/issues{/number}", + "pulls_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/pulls{/number}", + "milestones_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/milestones{/number}", + "notifications_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/labels{/name}", + "releases_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/releases{/id}", + "deployments_url": "https://api.github.com/repos/cloudbeers/multibranch-demo/deployments", + "created_at": "2015-08-27T22:02:12Z", + "updated_at": "2023-08-23T06:28:13Z", + "pushed_at": "2023-11-15T06:52:14Z", + "git_url": "git://github.com/cloudbeers/multibranch-demo.git", + "ssh_url": "git@github.com:cloudbeers/multibranch-demo.git", + "clone_url": "https://github.com/cloudbeers/multibranch-demo.git", + "svn_url": "https://github.com/cloudbeers/multibranch-demo", + "homepage": "", + "size": 16, + "stargazers_count": 16, + "watchers_count": 16, + "language": "Go", + "has_issues": false, + "has_projects": false, + "has_downloads": true, + "has_wiki": false, + "has_pages": false, + "has_discussions": false, + "forks_count": 289, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 12, + "license": null, + "allow_forking": true, + "is_template": false, + "web_commit_signoff_required": false, + "topics": [], + "visibility": "public", + "forks": 289, + "open_issues": 12, + "watchers": 16, + "default_branch": "master" + }, + "network_count": 289, + "subscribers_count": 0 +} \ No newline at end of file diff --git a/src/test/resources/api/mappings/mapping-heads-master-multibranch-demo.json b/src/test/resources/api/mappings/mapping-heads-master-multibranch-demo.json new file mode 100644 index 000000000..caf2e0fba --- /dev/null +++ b/src/test/resources/api/mappings/mapping-heads-master-multibranch-demo.json @@ -0,0 +1,34 @@ +{ + "request": { + "url": "/repos/cloudbeers/multibranch-demo/git/refs/heads/master", + "method": "GET" + }, + "response": { + "status": 200, + "headers": { + "Server": "GitHub.com", + "Date": "Tue, 06 Dec 2016 17:32:20 GMT", + "Content-Type": "application/json; charset=utf-8", + "Transfer-Encoding": "chunked", + "Status": "200 OK", + "X-RateLimit-Limit": "600", + "X-RateLimit-Remaining": "592", + "X-RateLimit-Reset": "1481048932", + "Cache-Control": "public, max-age=60, s-maxage=60", + "Vary": ["Accept", "Accept-Encoding"], + "ETag": "W/\"c2c8faf1f6e6d92b68748342898f30e6\"", + "Last-Modified": "Mon, 21 Nov 2016 22:53:53 GMT", + "X-Poll-Interval": "300", + "X-GitHub-Media-Type": "github.v3; format=json", + "Access-Control-Expose-Headers": "ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval", + "Access-Control-Allow-Origin": "*", + "Content-Security-Policy": "default-src 'none'", + "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "deny", + "X-XSS-Protection": "1; mode=block", + "X-Served-By": "a7f8a126c9ed3f1c4715a34c0ddc7290", + "X-GitHub-Request-Id": "BC8D23FA:31E4:269B4EB3:5846F623" + } + } +} \ No newline at end of file diff --git a/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo-branches.json b/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo-branches.json new file mode 100644 index 000000000..07872f7fc --- /dev/null +++ b/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo-branches.json @@ -0,0 +1,37 @@ +{ + "id" : "aa79da5c-1c10-38da-a5b8-107c9a033cea", + "request" : { + "url" : "/repos/cloudbeers/multibranch-demo/branches", + "method" : "GET" + }, + "response" : { + "status" : 200, + "bodyFileName" : "body-repos-cloudbeers-multibranch-demo-branches.json", + "headers" : { + "Date" : "Thu, 26 Sep 2024 12:20:51 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Cache-Control" : "private, max-age=60, s-maxage=60", + "Vary" : "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With", + "ETag" : "W/\"ac7433490cc75b1fc28d5b95a7ed4fa3bfcd345fee52e1339d9cf83cd42b1608\"", + "X-GitHub-Media-Type" : "github.v3; format=json", + "x-accepted-github-permissions" : "contents=read", + "x-github-api-version-selected" : "2022-11-28", + "X-RateLimit-Limit" : "5000", + "X-RateLimit-Remaining" : "4987", + "X-RateLimit-Reset" : "1727355030", + "X-RateLimit-Used" : "13", + "X-RateLimit-Resource" : "core", + "Access-Control-Expose-Headers" : "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin" : "*", + "Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options" : "deny", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "0", + "Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy" : "default-src 'none'", + "Server" : "github.com", + "X-GitHub-Request-Id" : "8758:D18C5:2AB2445:2B2ECA5:66F551A3" + } + }, + "uuid" : "aa79da5c-1c10-38da-a5b8-107c9a033cea" +} \ No newline at end of file diff --git a/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo-contents.json b/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo-contents.json new file mode 100644 index 000000000..362a8f2b4 --- /dev/null +++ b/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo-contents.json @@ -0,0 +1,38 @@ +{ + "id" : "709e493b-c71f-3498-a60a-7593c55c91ab", + "request" : { + "url" : "/repos/cloudbeers/multibranch-demo/contents/?ref=refs%2Fheads%2Fmaster", + "method" : "GET" + }, + "response" : { + "status" : 200, + "bodyFileName" : "body-repos-cloudbeers-multibranch-demo-contents.json", + "headers" : { + "Date" : "Thu, 26 Sep 2024 12:20:52 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Cache-Control" : "private, max-age=60, s-maxage=60", + "Vary" : "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With", + "ETag" : "W/\"f88e478beb5b1bf8ec0db3181a069d9a65b27c45\"", + "Last-Modified" : "Thu, 26 Sep 2024 08:09:07 GMT", + "X-GitHub-Media-Type" : "github.v3; format=json", + "x-accepted-github-permissions" : "contents=read", + "x-github-api-version-selected" : "2022-11-28", + "X-RateLimit-Limit" : "5000", + "X-RateLimit-Remaining" : "4985", + "X-RateLimit-Reset" : "1727355030", + "X-RateLimit-Used" : "15", + "X-RateLimit-Resource" : "core", + "Access-Control-Expose-Headers" : "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin" : "*", + "Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options" : "deny", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "0", + "Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy" : "default-src 'none'", + "Server" : "github.com", + "X-GitHub-Request-Id" : "876A:1E055D:2328CC4:23A4BEC:66F551A4" + } + }, + "uuid" : "709e493b-c71f-3498-a60a-7593c55c91ab" +} \ No newline at end of file diff --git a/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo-pulls.json b/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo-pulls.json new file mode 100644 index 000000000..9a2052afa --- /dev/null +++ b/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo-pulls.json @@ -0,0 +1,37 @@ +{ + "id" : "5594e071-e579-37e5-8889-b38bca1dff66", + "request" : { + "url" : "/repos/cloudbeers/multibranch-demo/pulls?state=open", + "method" : "GET" + }, + "response" : { + "status" : 200, + "bodyFileName" : "body-repos-cloudbeers-multibranch-demo-pulls.json", + "headers" : { + "Date" : "Thu, 26 Sep 2024 12:20:52 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Cache-Control" : "private, max-age=60, s-maxage=60", + "Vary" : "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With", + "ETag" : "\"c9bb29944c8a4b44f8ab5045d1c6fd23883785ce3e1e34f546c2aaf90aee71e6\"", + "X-GitHub-Media-Type" : "github.v3; param=shadow-cat-preview; format=json", + "x-accepted-github-permissions" : "pull_requests=read", + "x-github-api-version-selected" : "2022-11-28", + "X-RateLimit-Limit" : "5000", + "X-RateLimit-Remaining" : "4986", + "X-RateLimit-Reset" : "1727355030", + "X-RateLimit-Used" : "14", + "X-RateLimit-Resource" : "core", + "Access-Control-Expose-Headers" : "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin" : "*", + "Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options" : "deny", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "0", + "Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy" : "default-src 'none'", + "Server" : "github.com", + "X-GitHub-Request-Id" : "8764:148740:248BD97:2507E3E:66F551A3" + } + }, + "uuid" : "5594e071-e579-37e5-8889-b38bca1dff66" +} \ No newline at end of file diff --git a/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo.json b/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo.json new file mode 100644 index 000000000..539df9147 --- /dev/null +++ b/src/test/resources/api/mappings/mapping-repos-cloudbeers-multibranch-demo.json @@ -0,0 +1,38 @@ +{ + "id" : "e994c495-35d4-3151-b891-02a8f7c938a4", + "request" : { + "url" : "/repos/cloudbeers/multibranch-demo", + "method" : "GET" + }, + "response" : { + "status" : 200, + "bodyFileName" : "body-repos-cloudbeers-multibranch-demo.json", + "headers" : { + "Date" : "Thu, 26 Sep 2024 12:20:50 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Cache-Control" : "private, max-age=60, s-maxage=60", + "Vary" : "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With", + "ETag" : "W/\"5ec62610bf83ab336790667a37b9eea6e82a8abc4a0600111cca4ba01fa13932\"", + "Last-Modified" : "Thu, 26 Sep 2024 08:09:07 GMT", + "X-GitHub-Media-Type" : "github.v3; format=json", + "x-accepted-github-permissions" : "metadata=read", + "x-github-api-version-selected" : "2022-11-28", + "X-RateLimit-Limit" : "5000", + "X-RateLimit-Remaining" : "4988", + "X-RateLimit-Reset" : "1727355030", + "X-RateLimit-Used" : "12", + "X-RateLimit-Resource" : "core", + "Access-Control-Expose-Headers" : "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin" : "*", + "Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options" : "deny", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "0", + "Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy" : "default-src 'none'", + "Server" : "github.com", + "X-GitHub-Request-Id" : "8744:368155:2B52D6F:2BCF610:66F551A2" + } + }, + "uuid" : "e994c495-35d4-3151-b891-02a8f7c938a4" +} \ No newline at end of file diff --git a/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo-246cb389-de10-4107-b15d-3e196ab85e31.json b/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo-246cb389-de10-4107-b15d-3e196ab85e31.json new file mode 100644 index 000000000..ecd2a65c9 --- /dev/null +++ b/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo-246cb389-de10-4107-b15d-3e196ab85e31.json @@ -0,0 +1,39 @@ +{ + "id" : "246cb389-de10-4107-b15d-3e196ab85e31", + "name" : "repos_cloudbeers_multibranch-demo", + "request" : { + "url" : "/repos/cloudbeers/multibranch-demo", + "method" : "GET" + }, + "response" : { + "status" : 304, + "headers" : { + "Date" : "Thu, 26 Sep 2024 12:20:51 GMT", + "Cache-Control" : "private, max-age=60, s-maxage=60", + "Vary" : "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With", + "ETag" : "\"5ec62610bf83ab336790667a37b9eea6e82a8abc4a0600111cca4ba01fa13932\"", + "Last-Modified" : "Thu, 26 Sep 2024 08:09:07 GMT", + "x-github-api-version-selected" : "2022-11-28", + "X-RateLimit-Limit" : "5000", + "X-RateLimit-Remaining" : "4988", + "X-RateLimit-Reset" : "1727355030", + "X-RateLimit-Used" : "12", + "X-RateLimit-Resource" : "core", + "Access-Control-Expose-Headers" : "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin" : "*", + "Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options" : "deny", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "0", + "Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy" : "default-src 'none'", + "Server" : "github.com", + "X-GitHub-Request-Id" : "8754:1D857C:25BB9AB:2638225:66F551A3" + } + }, + "uuid" : "246cb389-de10-4107-b15d-3e196ab85e31", + "persistent" : true, + "scenarioName" : "scenario-2-repos-cloudbeers-multibranch-demo", + "requiredScenarioState" : "scenario-2-repos-cloudbeers-multibranch-demo-2", + "insertionIndex" : 8 +} \ No newline at end of file diff --git a/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo-b4c16031-4f2e-48d3-9e8f-18b715668e85.json b/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo-b4c16031-4f2e-48d3-9e8f-18b715668e85.json new file mode 100644 index 000000000..8bcdf1ff7 --- /dev/null +++ b/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo-b4c16031-4f2e-48d3-9e8f-18b715668e85.json @@ -0,0 +1,44 @@ +{ + "id" : "b4c16031-4f2e-48d3-9e8f-18b715668e85", + "name" : "repos_cloudbeers_multibranch-demo", + "request" : { + "url" : "/repos/cloudbeers/multibranch-demo", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "{\"id\":863392439,\"node_id\":\"R_kgDOM3ZStw\",\"name\":\"multibranch-demo\",\"full_name\":\"cloudbeers/multibranch-demo\",\"private\":false,\"owner\":{\"login\":\"cloudbeers\",\"id\":814127,\"node_id\":\"MDQ6VXNlcjgxNDEyNw==\",\"avatar_url\":\"https://avatars.githubusercontent.com/u/4181899?v=3\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/cloudbeers\",\"html_url\":\"https://github.com/cloudbeers\",\"followers_url\":\"https://api.github.com/users/cloudbeers/followers\",\"following_url\":\"https://api.github.com/users/cloudbeers/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/cloudbeers/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/cloudbeers/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/cloudbeers/subscriptions\",\"organizations_url\":\"https://api.github.com/users/cloudbeers/orgs\",\"repos_url\":\"https://api.github.com/users/cloudbeers/repos\",\"events_url\":\"https://api.github.com/users/cloudbeers/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/cloudbeers/received_events\",\"type\":\"User\",\"site_admin\":false},\"html_url\":\"https://github.com/cloudbeers/multibranch-demo\",\"description\":\"Simple demonstration of how to use multibranch pipelines\",\"fork\":true,\"url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo\",\"forks_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/forks\",\"keys_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/keys{/key_id}\",\"collaborators_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/collaborators{/collaborator}\",\"teams_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/teams\",\"hooks_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/hooks\",\"issue_events_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/issues/events{/number}\",\"events_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/events\",\"assignees_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/assignees{/user}\",\"branches_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/branches{/branch}\",\"tags_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/tags\",\"blobs_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs{/sha}\",\"git_tags_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/tags{/sha}\",\"git_refs_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/refs{/sha}\",\"trees_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/trees{/sha}\",\"statuses_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/statuses/{sha}\",\"languages_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/languages\",\"stargazers_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/stargazers\",\"contributors_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contributors\",\"subscribers_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/subscribers\",\"subscription_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/subscription\",\"commits_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/commits{/sha}\",\"git_commits_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/commits{/sha}\",\"comments_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/comments{/number}\",\"issue_comment_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/issues/comments{/number}\",\"contents_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contents/{+path}\",\"compare_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/compare/{base}...{head}\",\"merges_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/merges\",\"archive_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/{archive_format}{/ref}\",\"downloads_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/downloads\",\"issues_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/issues{/number}\",\"pulls_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/pulls{/number}\",\"milestones_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/milestones{/number}\",\"notifications_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/notifications{?since,all,participating}\",\"labels_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/labels{/name}\",\"releases_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/releases{/id}\",\"deployments_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/deployments\",\"created_at\":\"2024-09-26T08:09:07Z\",\"updated_at\":\"2024-09-26T08:09:07Z\",\"pushed_at\":\"2023-11-15T06:52:14Z\",\"git_url\":\"git://github.com/cloudbeers/multibranch-demo.git\",\"ssh_url\":\"git@github.com:cloudbeers/multibranch-demo.git\",\"clone_url\":\"https://github.com/cloudbeers/multibranch-demo.git\",\"svn_url\":\"https://github.com/cloudbeers/multibranch-demo\",\"homepage\":\"\",\"size\":16,\"stargazers_count\":0,\"watchers_count\":0,\"language\":null,\"has_issues\":false,\"has_projects\":true,\"has_downloads\":true,\"has_wiki\":false,\"has_pages\":false,\"has_discussions\":false,\"forks_count\":0,\"mirror_url\":null,\"archived\":false,\"disabled\":false,\"open_issues_count\":0,\"license\":null,\"allow_forking\":true,\"is_template\":false,\"web_commit_signoff_required\":false,\"topics\":[],\"visibility\":\"public\",\"forks\":0,\"open_issues\":0,\"watchers\":0,\"default_branch\":\"master\",\"permissions\":{\"admin\":false,\"maintain\":false,\"push\":false,\"triage\":false,\"pull\":false},\"temp_clone_token\":\"\",\"parent\":{\"id\":41513585,\"node_id\":\"MDEwOlJlcG9zaXRvcnk0MTUxMzU4NQ==\",\"name\":\"multibranch-demo\",\"full_name\":\"cloudbeers/multibranch-demo\",\"private\":false,\"owner\":{\"login\":\"cloudbeers\",\"id\":4181899,\"node_id\":\"MDEyOk9yZ2FuaXphdGlvbjQxODE4OTk=\",\"avatar_url\":\"https://avatars.githubusercontent.com/u/4181899?v=4\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/cloudbeers\",\"html_url\":\"https://github.com/cloudbeers\",\"followers_url\":\"https://api.github.com/users/cloudbeers/followers\",\"following_url\":\"https://api.github.com/users/cloudbeers/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/cloudbeers/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/cloudbeers/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/cloudbeers/subscriptions\",\"organizations_url\":\"https://api.github.com/users/cloudbeers/orgs\",\"repos_url\":\"https://api.github.com/users/cloudbeers/repos\",\"events_url\":\"https://api.github.com/users/cloudbeers/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/cloudbeers/received_events\",\"type\":\"Organization\",\"site_admin\":false},\"html_url\":\"https://github.com/cloudbeers/multibranch-demo\",\"description\":\"Simple demonstration of how to use multibranch pipelines\",\"fork\":false,\"url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo\",\"forks_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/forks\",\"keys_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/keys{/key_id}\",\"collaborators_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/collaborators{/collaborator}\",\"teams_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/teams\",\"hooks_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/hooks\",\"issue_events_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/issues/events{/number}\",\"events_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/events\",\"assignees_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/assignees{/user}\",\"branches_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/branches{/branch}\",\"tags_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/tags\",\"blobs_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs{/sha}\",\"git_tags_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/tags{/sha}\",\"git_refs_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/refs{/sha}\",\"trees_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/trees{/sha}\",\"statuses_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/statuses/{sha}\",\"languages_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/languages\",\"stargazers_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/stargazers\",\"contributors_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contributors\",\"subscribers_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/subscribers\",\"subscription_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/subscription\",\"commits_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/commits{/sha}\",\"git_commits_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/commits{/sha}\",\"comments_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/comments{/number}\",\"issue_comment_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/issues/comments{/number}\",\"contents_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contents/{+path}\",\"compare_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/compare/{base}...{head}\",\"merges_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/merges\",\"archive_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/{archive_format}{/ref}\",\"downloads_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/downloads\",\"issues_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/issues{/number}\",\"pulls_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/pulls{/number}\",\"milestones_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/milestones{/number}\",\"notifications_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/notifications{?since,all,participating}\",\"labels_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/labels{/name}\",\"releases_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/releases{/id}\",\"deployments_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/deployments\",\"created_at\":\"2015-08-27T22:02:12Z\",\"updated_at\":\"2023-08-23T06:28:13Z\",\"pushed_at\":\"2023-11-15T06:52:14Z\",\"git_url\":\"git://github.com/cloudbeers/multibranch-demo.git\",\"ssh_url\":\"git@github.com:cloudbeers/multibranch-demo.git\",\"clone_url\":\"https://github.com/cloudbeers/multibranch-demo.git\",\"svn_url\":\"https://github.com/cloudbeers/multibranch-demo\",\"homepage\":\"\",\"size\":16,\"stargazers_count\":16,\"watchers_count\":16,\"language\":\"Go\",\"has_issues\":false,\"has_projects\":false,\"has_downloads\":true,\"has_wiki\":false,\"has_pages\":false,\"has_discussions\":false,\"forks_count\":289,\"mirror_url\":null,\"archived\":false,\"disabled\":false,\"open_issues_count\":12,\"license\":null,\"allow_forking\":true,\"is_template\":false,\"web_commit_signoff_required\":false,\"topics\":[],\"visibility\":\"public\",\"forks\":289,\"open_issues\":12,\"watchers\":16,\"default_branch\":\"master\"},\"source\":{\"id\":41513585,\"node_id\":\"MDEwOlJlcG9zaXRvcnk0MTUxMzU4NQ==\",\"name\":\"multibranch-demo\",\"full_name\":\"cloudbeers/multibranch-demo\",\"private\":false,\"owner\":{\"login\":\"cloudbeers\",\"id\":4181899,\"node_id\":\"MDEyOk9yZ2FuaXphdGlvbjQxODE4OTk=\",\"avatar_url\":\"https://avatars.githubusercontent.com/u/4181899?v=4\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/cloudbeers\",\"html_url\":\"https://github.com/cloudbeers\",\"followers_url\":\"https://api.github.com/users/cloudbeers/followers\",\"following_url\":\"https://api.github.com/users/cloudbeers/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/cloudbeers/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/cloudbeers/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/cloudbeers/subscriptions\",\"organizations_url\":\"https://api.github.com/users/cloudbeers/orgs\",\"repos_url\":\"https://api.github.com/users/cloudbeers/repos\",\"events_url\":\"https://api.github.com/users/cloudbeers/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/cloudbeers/received_events\",\"type\":\"Organization\",\"site_admin\":false},\"html_url\":\"https://github.com/cloudbeers/multibranch-demo\",\"description\":\"Simple demonstration of how to use multibranch pipelines\",\"fork\":false,\"url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo\",\"forks_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/forks\",\"keys_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/keys{/key_id}\",\"collaborators_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/collaborators{/collaborator}\",\"teams_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/teams\",\"hooks_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/hooks\",\"issue_events_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/issues/events{/number}\",\"events_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/events\",\"assignees_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/assignees{/user}\",\"branches_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/branches{/branch}\",\"tags_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/tags\",\"blobs_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs{/sha}\",\"git_tags_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/tags{/sha}\",\"git_refs_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/refs{/sha}\",\"trees_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/trees{/sha}\",\"statuses_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/statuses/{sha}\",\"languages_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/languages\",\"stargazers_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/stargazers\",\"contributors_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contributors\",\"subscribers_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/subscribers\",\"subscription_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/subscription\",\"commits_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/commits{/sha}\",\"git_commits_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/commits{/sha}\",\"comments_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/comments{/number}\",\"issue_comment_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/issues/comments{/number}\",\"contents_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contents/{+path}\",\"compare_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/compare/{base}...{head}\",\"merges_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/merges\",\"archive_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/{archive_format}{/ref}\",\"downloads_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/downloads\",\"issues_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/issues{/number}\",\"pulls_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/pulls{/number}\",\"milestones_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/milestones{/number}\",\"notifications_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/notifications{?since,all,participating}\",\"labels_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/labels{/name}\",\"releases_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/releases{/id}\",\"deployments_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/deployments\",\"created_at\":\"2015-08-27T22:02:12Z\",\"updated_at\":\"2023-08-23T06:28:13Z\",\"pushed_at\":\"2023-11-15T06:52:14Z\",\"git_url\":\"git://github.com/cloudbeers/multibranch-demo.git\",\"ssh_url\":\"git@github.com:cloudbeers/multibranch-demo.git\",\"clone_url\":\"https://github.com/cloudbeers/multibranch-demo.git\",\"svn_url\":\"https://github.com/cloudbeers/multibranch-demo\",\"homepage\":\"\",\"size\":16,\"stargazers_count\":16,\"watchers_count\":16,\"language\":\"Go\",\"has_issues\":false,\"has_projects\":false,\"has_downloads\":true,\"has_wiki\":false,\"has_pages\":false,\"has_discussions\":false,\"forks_count\":289,\"mirror_url\":null,\"archived\":false,\"disabled\":false,\"open_issues_count\":12,\"license\":null,\"allow_forking\":true,\"is_template\":false,\"web_commit_signoff_required\":false,\"topics\":[],\"visibility\":\"public\",\"forks\":289,\"open_issues\":12,\"watchers\":16,\"default_branch\":\"master\"},\"network_count\":289,\"subscribers_count\":0}", + "headers" : { + "Date" : "Thu, 26 Sep 2024 12:20:50 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Cache-Control" : "private, max-age=60, s-maxage=60", + "Vary" : "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With", + "ETag" : "W/\"5ec62610bf83ab336790667a37b9eea6e82a8abc4a0600111cca4ba01fa13932\"", + "Last-Modified" : "Thu, 26 Sep 2024 08:09:07 GMT", + "X-GitHub-Media-Type" : "github.v3; format=json", + "x-accepted-github-permissions" : "metadata=read", + "x-github-api-version-selected" : "2022-11-28", + "X-RateLimit-Limit" : "5000", + "X-RateLimit-Remaining" : "4988", + "X-RateLimit-Reset" : "1727355030", + "X-RateLimit-Used" : "12", + "X-RateLimit-Resource" : "core", + "Access-Control-Expose-Headers" : "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin" : "*", + "Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options" : "deny", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "0", + "Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy" : "default-src 'none'", + "Server" : "github.com", + "X-GitHub-Request-Id" : "8744:368155:2B52D6F:2BCF610:66F551A2" + } + }, + "uuid" : "b4c16031-4f2e-48d3-9e8f-18b715668e85", + "persistent" : true, + "scenarioName" : "scenario-2-repos-cloudbeers-multibranch-demo", + "requiredScenarioState" : "Started", + "newScenarioState" : "scenario-2-repos-cloudbeers-multibranch-demo-2", + "insertionIndex" : 7 +} \ No newline at end of file diff --git a/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo_branches-56146577-6102-4b67-8ff5-dda35e121214.json b/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo_branches-56146577-6102-4b67-8ff5-dda35e121214.json new file mode 100644 index 000000000..47106d8cc --- /dev/null +++ b/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo_branches-56146577-6102-4b67-8ff5-dda35e121214.json @@ -0,0 +1,40 @@ +{ + "id" : "56146577-6102-4b67-8ff5-dda35e121214", + "name" : "repos_cloudbeers_multibranch-demo_branches", + "request" : { + "url" : "/repos/cloudbeers/multibranch-demo/branches", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "[{\"name\":\"master\",\"commit\":{\"sha\":\"ba1fdaa6c2088cecea85333e763710cd3f39688f\",\"url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/commits/ba1fdaa6c2088cecea85333e763710cd3f39688f\"},\"protected\":false}]", + "headers" : { + "Date" : "Thu, 26 Sep 2024 12:20:51 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Cache-Control" : "private, max-age=60, s-maxage=60", + "Vary" : "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With", + "ETag" : "W/\"ac7433490cc75b1fc28d5b95a7ed4fa3bfcd345fee52e1339d9cf83cd42b1608\"", + "X-GitHub-Media-Type" : "github.v3; format=json", + "x-accepted-github-permissions" : "contents=read", + "x-github-api-version-selected" : "2022-11-28", + "X-RateLimit-Limit" : "5000", + "X-RateLimit-Remaining" : "4987", + "X-RateLimit-Reset" : "1727355030", + "X-RateLimit-Used" : "13", + "X-RateLimit-Resource" : "core", + "Access-Control-Expose-Headers" : "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin" : "*", + "Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options" : "deny", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "0", + "Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy" : "default-src 'none'", + "Server" : "github.com", + "X-GitHub-Request-Id" : "8758:D18C5:2AB2445:2B2ECA5:66F551A3" + } + }, + "uuid" : "56146577-6102-4b67-8ff5-dda35e121214", + "persistent" : true, + "insertionIndex" : 9 +} \ No newline at end of file diff --git a/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo_contents-a229ac51-4da6-4347-9020-0841161e284c.json b/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo_contents-a229ac51-4da6-4347-9020-0841161e284c.json new file mode 100644 index 000000000..340f83299 --- /dev/null +++ b/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo_contents-a229ac51-4da6-4347-9020-0841161e284c.json @@ -0,0 +1,41 @@ +{ + "id" : "a229ac51-4da6-4347-9020-0841161e284c", + "name" : "repos_cloudbeers_multibranch-demo_contents", + "request" : { + "url" : "/repos/cloudbeers/multibranch-demo/contents/?ref=refs%2Fheads%2Fmaster", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "[{\"name\":\"Jenkinsfile\",\"path\":\"Jenkinsfile\",\"sha\":\"98c0f1dad6a7874ff6a7ccc4dd72a5519ec8fdba\",\"size\":351,\"url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contents/Jenkinsfile?ref=refs/heads/master\",\"html_url\":\"https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/Jenkinsfile\",\"git_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/98c0f1dad6a7874ff6a7ccc4dd72a5519ec8fdba\",\"download_url\":\"https://raw.githubusercontent.com/cloudbeers/multibranch-demo/refs/heads/master/Jenkinsfile\",\"type\":\"file\",\"_links\":{\"self\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contents/Jenkinsfile?ref=refs/heads/master\",\"git\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/98c0f1dad6a7874ff6a7ccc4dd72a5519ec8fdba\",\"html\":\"https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/Jenkinsfile\"}},{\"name\":\"README.md\",\"path\":\"README.md\",\"sha\":\"59e16b0d408539ab4f23d64f2cafd33495eb21ad\",\"size\":131,\"url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contents/README.md?ref=refs/heads/master\",\"html_url\":\"https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/README.md\",\"git_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/59e16b0d408539ab4f23d64f2cafd33495eb21ad\",\"download_url\":\"https://raw.githubusercontent.com/cloudbeers/multibranch-demo/refs/heads/master/README.md\",\"type\":\"file\",\"_links\":{\"self\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contents/README.md?ref=refs/heads/master\",\"git\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/59e16b0d408539ab4f23d64f2cafd33495eb21ad\",\"html\":\"https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/README.md\"}},{\"name\":\"hello-world.go\",\"path\":\"hello-world.go\",\"sha\":\"b64817ed596a1dae19dfa3f8a6e6bc26506cc645\",\"size\":75,\"url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contents/hello-world.go?ref=refs/heads/master\",\"html_url\":\"https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/hello-world.go\",\"git_url\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/b64817ed596a1dae19dfa3f8a6e6bc26506cc645\",\"download_url\":\"https://raw.githubusercontent.com/cloudbeers/multibranch-demo/refs/heads/master/hello-world.go\",\"type\":\"file\",\"_links\":{\"self\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/contents/hello-world.go?ref=refs/heads/master\",\"git\":\"https://api.github.com/repos/cloudbeers/multibranch-demo/git/blobs/b64817ed596a1dae19dfa3f8a6e6bc26506cc645\",\"html\":\"https://github.com/cloudbeers/multibranch-demo/blob/refs/heads/master/hello-world.go\"}}]", + "headers" : { + "Date" : "Thu, 26 Sep 2024 12:20:52 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Cache-Control" : "private, max-age=60, s-maxage=60", + "Vary" : "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With", + "ETag" : "W/\"f88e478beb5b1bf8ec0db3181a069d9a65b27c45\"", + "Last-Modified" : "Thu, 26 Sep 2024 08:09:07 GMT", + "X-GitHub-Media-Type" : "github.v3; format=json", + "x-accepted-github-permissions" : "contents=read", + "x-github-api-version-selected" : "2022-11-28", + "X-RateLimit-Limit" : "5000", + "X-RateLimit-Remaining" : "4985", + "X-RateLimit-Reset" : "1727355030", + "X-RateLimit-Used" : "15", + "X-RateLimit-Resource" : "core", + "Access-Control-Expose-Headers" : "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin" : "*", + "Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options" : "deny", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "0", + "Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy" : "default-src 'none'", + "Server" : "github.com", + "X-GitHub-Request-Id" : "876A:1E055D:2328CC4:23A4BEC:66F551A4" + } + }, + "uuid" : "a229ac51-4da6-4347-9020-0841161e284c", + "persistent" : true, + "insertionIndex" : 11 +} \ No newline at end of file diff --git a/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo_pulls-bf8d15e5-90b7-4ab6-8f02-422911e06ece.json b/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo_pulls-bf8d15e5-90b7-4ab6-8f02-422911e06ece.json new file mode 100644 index 000000000..2c3cb4a1c --- /dev/null +++ b/src/test/resources/api/mappings/repos_cloudbeers_multibranch-demo_pulls-bf8d15e5-90b7-4ab6-8f02-422911e06ece.json @@ -0,0 +1,40 @@ +{ + "id" : "bf8d15e5-90b7-4ab6-8f02-422911e06ece", + "name" : "repos_cloudbeers_multibranch-demo_pulls", + "request" : { + "url" : "/repos/cloudbeers/multibranch-demo/pulls?state=open", + "method" : "GET" + }, + "response" : { + "status" : 200, + "body" : "[]", + "headers" : { + "Date" : "Thu, 26 Sep 2024 12:20:52 GMT", + "Content-Type" : "application/json; charset=utf-8", + "Cache-Control" : "private, max-age=60, s-maxage=60", + "Vary" : "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With", + "ETag" : "\"c9bb29944c8a4b44f8ab5045d1c6fd23883785ce3e1e34f546c2aaf90aee71e6\"", + "X-GitHub-Media-Type" : "github.v3; param=shadow-cat-preview; format=json", + "x-accepted-github-permissions" : "pull_requests=read", + "x-github-api-version-selected" : "2022-11-28", + "X-RateLimit-Limit" : "5000", + "X-RateLimit-Remaining" : "4986", + "X-RateLimit-Reset" : "1727355030", + "X-RateLimit-Used" : "14", + "X-RateLimit-Resource" : "core", + "Access-Control-Expose-Headers" : "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", + "Access-Control-Allow-Origin" : "*", + "Strict-Transport-Security" : "max-age=31536000; includeSubdomains; preload", + "X-Frame-Options" : "deny", + "X-Content-Type-Options" : "nosniff", + "X-XSS-Protection" : "0", + "Referrer-Policy" : "origin-when-cross-origin, strict-origin-when-cross-origin", + "Content-Security-Policy" : "default-src 'none'", + "Server" : "github.com", + "X-GitHub-Request-Id" : "8764:148740:248BD97:2507E3E:66F551A3" + } + }, + "uuid" : "bf8d15e5-90b7-4ab6-8f02-422911e06ece", + "persistent" : true, + "insertionIndex" : 10 +} \ No newline at end of file