From 4c791fc1f4b498c4317aa81099310f7a6af83dae Mon Sep 17 00:00:00 2001 From: Philipp Schirmer Date: Mon, 26 Feb 2024 13:46:51 +0100 Subject: [PATCH] Use Gradle Nexus Publish Plugin --- .../kotlin/com/bakdata/gradle/SonatypePluginIT.kt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt b/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt index 5d483f6..6463825 100644 --- a/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt +++ b/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt @@ -28,6 +28,7 @@ import com.github.tomakehurst.wiremock.WireMockServer import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.http.RequestMethod import com.github.tomakehurst.wiremock.stubbing.Scenario.STARTED +import org.apache.http.protocol.HTTP import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Condition import org.assertj.core.api.SoftAssertions @@ -139,14 +140,10 @@ internal class SonatypePluginIT { wiremock.stubFor(post(urlMatching("/staging/bulk/close")) .willReturn(okJson("{}"))) wiremock.stubFor(get(urlMatching("/staging/repository/$STAGING_ID")) - .willReturn(notFound())) - wiremock.stubFor(post(urlMatching("/staging/bulk/promote")) - .inScenario("promoting").whenScenarioStateIs(STARTED) - .willReturn(okJson("{}")) - .willSetStateTo("promoting")) - wiremock.stubFor(get(urlMatching("/staging/repository/$STAGING_ID")) - .inScenario("promoting").whenScenarioStateIs("promoting") - .willReturn(okJson("""{"type": "released", "transitioning": false}"""))) + .willReturn(aResponse() + .withStatus(404) + .withHeader(HTTP.CONTENT_TYPE, "application/json") + .withBody("""{"repositoryId": "$STAGING_ID", "type": "closed", "transitioning": false}"""))) } @Disabled