From b2864e5b6acf26c5a12b8600ffd7a5468a0537c7 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Thu, 23 Feb 2023 12:01:33 +0100 Subject: [PATCH 1/2] Mock GitHub API This commit mocks the GitHub API in tests. --- build.gradle | 3 + .../micronaut/build/utils/GithubApiUtils.java | 5 +- .../build/utils/GithubApiUtilsSpec.groovy | 46 ++- .../io.micronaut.build.utils/releases.json | 302 ++++++++++++++++++ 4 files changed, 352 insertions(+), 4 deletions(-) create mode 100644 src/test/resources/io.micronaut.build.utils/releases.json diff --git a/build.gradle b/build.gradle index c819187a..074ea8fe 100644 --- a/build.gradle +++ b/build.gradle @@ -75,6 +75,9 @@ dependencies { testImplementation("com.typesafe:config:1.4.2") + testImplementation("org.mock-server:mockserver-netty:5.14.0") + testImplementation("org.mock-server:mockserver-client-java:5.14.0") + functionalTestImplementation("org.mock-server:mockserver-netty:5.14.0") functionalTestImplementation("org.mock-server:mockserver-client-java:5.14.0") diff --git a/src/main/java/io/micronaut/build/utils/GithubApiUtils.java b/src/main/java/io/micronaut/build/utils/GithubApiUtils.java index 091624e7..44a42c5d 100644 --- a/src/main/java/io/micronaut/build/utils/GithubApiUtils.java +++ b/src/main/java/io/micronaut/build/utils/GithubApiUtils.java @@ -32,6 +32,9 @@ public final class GithubApiUtils { private static final String GH_TOKEN_PUBLIC_REPOS_READONLY = "GH_TOKEN_PUBLIC_REPOS_READONLY"; private static final String GH_USERNAME = "GH_USERNAME"; + public static final String GITHUB_API_BASE_URL_SYSTEM_PROPERTY = "github.api.base.url"; + public static final String GITHUB_BASE_API_URL = "https://api.github.com"; + private GithubApiUtils() { } @@ -44,7 +47,7 @@ static byte[] fetchTagsFromGitHub(Logger logger, String slug) { } private static byte[] fetchFromGithub(Logger logger, String slug, String what) { - String url = "https://api.github.com/repos/" + normalizeSlug(slug) + "/" + what; + String url = System.getProperty(GITHUB_API_BASE_URL_SYSTEM_PROPERTY, GITHUB_BASE_API_URL) + "/repos/" + normalizeSlug(slug) + "/" + what; try { return fetchFromGithub(logger, connectionForGithubUrl(logger, url)); } catch (IOException ex) { diff --git a/src/test/groovy/io/micronaut/build/utils/GithubApiUtilsSpec.groovy b/src/test/groovy/io/micronaut/build/utils/GithubApiUtilsSpec.groovy index 70b9aff1..cedd49c4 100644 --- a/src/test/groovy/io/micronaut/build/utils/GithubApiUtilsSpec.groovy +++ b/src/test/groovy/io/micronaut/build/utils/GithubApiUtilsSpec.groovy @@ -2,14 +2,55 @@ package io.micronaut.build.utils import org.gradle.api.GradleException import org.gradle.api.logging.Logger +import org.mockserver.integration.ClientAndServer +import org.mockserver.model.MediaType +import spock.lang.Shared import spock.lang.Specification +import spock.util.environment.RestoreSystemProperties +import static org.mockserver.model.HttpRequest.request +import static org.mockserver.model.HttpResponse.response +@RestoreSystemProperties class GithubApiUtilsSpec extends Specification { + @Shared + private ClientAndServer mockServer + + def setupSpec() { + mockServer = ClientAndServer.startClientAndServer() + ['tags', 'releases'].each { what -> + mockServer.when( + request() + .withMethod("GET") + .withPath("/repos/micronaut-projects/micronaut-security/$what") + ).respond( + response() + .withStatusCode(200) + .withContentType(MediaType.JSON_UTF_8) + .withBody(GithubApiUtilsSpec.getResourceAsStream("/io.micronaut.build.utils/releases.json").bytes) + ) + mockServer.when( + request() + .withMethod("GET") + .withPath("/repos/micronaut-projects/nope/$what") + ).respond( + response() + .withStatusCode(404) + .withBody("Not found") + ) + } + + System.setProperty(GithubApiUtils.GITHUB_API_BASE_URL_SYSTEM_PROPERTY, "http://localhost:${mockServer.localPort}") + } + + def cleanupSpec() { + mockServer.stop() + } + void "it is possible to fetch tags"() { when: String tags = new String(GithubApiUtils.fetchTagsFromGitHub(Stub(Logger), "micronaut-projects/micronaut-security"), "UTF-8") - + println tags then: noExceptionThrown() tags.contains("v") @@ -18,7 +59,7 @@ class GithubApiUtilsSpec extends Specification { void "it is possible to fetch releases"() { when: String releases = new String(GithubApiUtils.fetchReleasesFromGitHub(Stub(Logger), "micronaut-projects/micronaut-security"), "UTF-8") - + println releases then: noExceptionThrown() releases.contains("3.") @@ -37,5 +78,4 @@ class GithubApiUtilsSpec extends Specification { assert message.startsWith("Failed to read from Github API. Response code: 404") } } - } diff --git a/src/test/resources/io.micronaut.build.utils/releases.json b/src/test/resources/io.micronaut.build.utils/releases.json new file mode 100644 index 00000000..c3b09782 --- /dev/null +++ b/src/test/resources/io.micronaut.build.utils/releases.json @@ -0,0 +1,302 @@ +[ + { + "name": "v3.9.2", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.9.2", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.9.2", + "commit": { + "sha": "d8af301f12489cce7c0b2d1c9f02522611353b90", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/d8af301f12489cce7c0b2d1c9f02522611353b90" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My45LjI=" + }, + { + "name": "v3.9.1", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.9.1", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.9.1", + "commit": { + "sha": "30852a7991e15bda2e0f44a359d7bea460c12b71", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/30852a7991e15bda2e0f44a359d7bea460c12b71" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My45LjE=" + }, + { + "name": "v3.9.0", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.9.0", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.9.0", + "commit": { + "sha": "d6f78a62f013dc7c0b8340c84c57cb13bf7e2248", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/d6f78a62f013dc7c0b8340c84c57cb13bf7e2248" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My45LjA=" + }, + { + "name": "v3.8.3", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.8.3", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.8.3", + "commit": { + "sha": "971349f6f4ade847d0c0886cff907cd8f328062b", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/971349f6f4ade847d0c0886cff907cd8f328062b" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My44LjM=" + }, + { + "name": "v3.8.2", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.8.2", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.8.2", + "commit": { + "sha": "ea51c3e3ec6a5f820b68d8e30fda64defea92931", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/ea51c3e3ec6a5f820b68d8e30fda64defea92931" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My44LjI=" + }, + { + "name": "v3.8.1", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.8.1", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.8.1", + "commit": { + "sha": "f90047201308edf2b76dd94b029998718c840007", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/f90047201308edf2b76dd94b029998718c840007" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My44LjE=" + }, + { + "name": "v3.8.0", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.8.0", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.8.0", + "commit": { + "sha": "bd036bd94b38d721e48bf30d0cb453d4799a75f9", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/bd036bd94b38d721e48bf30d0cb453d4799a75f9" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My44LjA=" + }, + { + "name": "v3.7.3", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.7.3", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.7.3", + "commit": { + "sha": "938d06019ddc7459338c6c9767a36da93286d21e", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/938d06019ddc7459338c6c9767a36da93286d21e" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My43LjM=" + }, + { + "name": "v3.7.2", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.7.2", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.7.2", + "commit": { + "sha": "788ad5047f3b5104d1d341256fcc44d159a4b3a8", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/788ad5047f3b5104d1d341256fcc44d159a4b3a8" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My43LjI=" + }, + { + "name": "v3.7.1", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.7.1", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.7.1", + "commit": { + "sha": "450c695b16ae029609f786a51fe8f1ca1f7c174d", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/450c695b16ae029609f786a51fe8f1ca1f7c174d" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My43LjE=" + }, + { + "name": "v3.7.0", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.7.0", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.7.0", + "commit": { + "sha": "44b4c260d26a25fc96f1aa7baf4bf0e0d6c44e89", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/44b4c260d26a25fc96f1aa7baf4bf0e0d6c44e89" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My43LjA=" + }, + { + "name": "v3.6.5", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.6.5", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.6.5", + "commit": { + "sha": "5e4a4f1440e77b27bb91f25a2ae4916c293cf661", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/5e4a4f1440e77b27bb91f25a2ae4916c293cf661" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My42LjU=" + }, + { + "name": "v3.6.4", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.6.4", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.6.4", + "commit": { + "sha": "4650329704e9359ddd5cca567d150b7ce0ff4d9d", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/4650329704e9359ddd5cca567d150b7ce0ff4d9d" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My42LjQ=" + }, + { + "name": "v3.6.3", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.6.3", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.6.3", + "commit": { + "sha": "80dd97aa7d11502c3e109b7a6d0df81b0c08a558", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/80dd97aa7d11502c3e109b7a6d0df81b0c08a558" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My42LjM=" + }, + { + "name": "v3.6.2", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.6.2", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.6.2", + "commit": { + "sha": "06a0dbbf5debac648d69d83bdbc2033c30753fa7", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/06a0dbbf5debac648d69d83bdbc2033c30753fa7" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My42LjI=" + }, + { + "name": "v3.6.1", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.6.1", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.6.1", + "commit": { + "sha": "a21bd78364ac67204df0685bbf0b1ea686038c95", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/a21bd78364ac67204df0685bbf0b1ea686038c95" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My42LjE=" + }, + { + "name": "v3.6.0", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.6.0", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.6.0", + "commit": { + "sha": "2fb6b9be8521cbaac46c9065609af34fe489b6c9", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/2fb6b9be8521cbaac46c9065609af34fe489b6c9" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My42LjA=" + }, + { + "name": "v3.5.2", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.5.2", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.5.2", + "commit": { + "sha": "a7fda9436b3bbd532b72ab0f424b4d56915bb09c", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/a7fda9436b3bbd532b72ab0f424b4d56915bb09c" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My41LjI=" + }, + { + "name": "v3.5.1", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.5.1", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.5.1", + "commit": { + "sha": "8236bb42959910c329ee74b8dbc5d97e64ae4a5d", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/8236bb42959910c329ee74b8dbc5d97e64ae4a5d" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My41LjE=" + }, + { + "name": "v3.5.0", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.5.0", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.5.0", + "commit": { + "sha": "2301f38015b598f788bf1d6f10fdec5edf3aa400", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/2301f38015b598f788bf1d6f10fdec5edf3aa400" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My41LjA=" + }, + { + "name": "v3.4.1", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.4.1", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.4.1", + "commit": { + "sha": "00bf0b43e4494b01fa5f093f4090337a30e55154", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/00bf0b43e4494b01fa5f093f4090337a30e55154" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My40LjE=" + }, + { + "name": "v3.4.0", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.4.0", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.4.0", + "commit": { + "sha": "13a0ef86d18031e1b6cad426dff30759d2674da6", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/13a0ef86d18031e1b6cad426dff30759d2674da6" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My40LjA=" + }, + { + "name": "v3.3.0", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.3.0", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.3.0", + "commit": { + "sha": "cf77c7c5101dc19ff52cc13967e2aa56898bf60b", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/cf77c7c5101dc19ff52cc13967e2aa56898bf60b" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My4zLjA=" + }, + { + "name": "v3.2.3", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.2.3", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.2.3", + "commit": { + "sha": "8866a327f4c249f5cd105e41773a8f973a593d10", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/8866a327f4c249f5cd105e41773a8f973a593d10" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My4yLjM=" + }, + { + "name": "v3.2.2", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.2.2", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.2.2", + "commit": { + "sha": "68d44b1e6a4111212ac2c59a9a68ab42ad3f6074", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/68d44b1e6a4111212ac2c59a9a68ab42ad3f6074" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My4yLjI=" + }, + { + "name": "v3.2.1", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.2.1", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.2.1", + "commit": { + "sha": "3a08ca8352bf741cb328ca9fb720abb8ba9d93ba", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/3a08ca8352bf741cb328ca9fb720abb8ba9d93ba" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My4yLjE=" + }, + { + "name": "v3.2.0", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.2.0", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.2.0", + "commit": { + "sha": "e67fe82d54f94d989a828226f3fd01150dc7f049", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/e67fe82d54f94d989a828226f3fd01150dc7f049" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My4yLjA=" + }, + { + "name": "v3.1.1", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.1.1", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.1.1", + "commit": { + "sha": "71d087ae2a1e5a4908474c85541ccac365a454a8", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/71d087ae2a1e5a4908474c85541ccac365a454a8" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My4xLjE=" + }, + { + "name": "v3.1.0", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.1.0", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.1.0", + "commit": { + "sha": "9d91f2162a221c135c4701d0114b183693034db3", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/9d91f2162a221c135c4701d0114b183693034db3" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My4xLjA=" + }, + { + "name": "v3.0.2", + "zipball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/zipball/refs/tags/v3.0.2", + "tarball_url": "https://api.github.com/repos/micronaut-projects/micronaut-security/tarball/refs/tags/v3.0.2", + "commit": { + "sha": "da870c6bd62113cd6a6e224cf131041241f72410", + "url": "https://api.github.com/repos/micronaut-projects/micronaut-security/commits/da870c6bd62113cd6a6e224cf131041241f72410" + }, + "node_id": "MDM6UmVmMTgxOTAwMDk2OnJlZnMvdGFncy92My4wLjI=" + } +] From 3c3d1c6d76a526afdfe05ed0656f816ceb79315c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Champeau?= Date: Fri, 24 Feb 2023 09:34:46 +0100 Subject: [PATCH 2/2] Remove test logs Co-authored-by: Sergio del Amo --- .../groovy/io/micronaut/build/utils/GithubApiUtilsSpec.groovy | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/test/groovy/io/micronaut/build/utils/GithubApiUtilsSpec.groovy b/src/test/groovy/io/micronaut/build/utils/GithubApiUtilsSpec.groovy index cedd49c4..c5b6df2c 100644 --- a/src/test/groovy/io/micronaut/build/utils/GithubApiUtilsSpec.groovy +++ b/src/test/groovy/io/micronaut/build/utils/GithubApiUtilsSpec.groovy @@ -50,7 +50,6 @@ class GithubApiUtilsSpec extends Specification { void "it is possible to fetch tags"() { when: String tags = new String(GithubApiUtils.fetchTagsFromGitHub(Stub(Logger), "micronaut-projects/micronaut-security"), "UTF-8") - println tags then: noExceptionThrown() tags.contains("v") @@ -59,7 +58,6 @@ class GithubApiUtilsSpec extends Specification { void "it is possible to fetch releases"() { when: String releases = new String(GithubApiUtils.fetchReleasesFromGitHub(Stub(Logger), "micronaut-projects/micronaut-security"), "UTF-8") - println releases then: noExceptionThrown() releases.contains("3.")