diff --git a/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt b/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt index c3525c9..db54ab7 100644 --- a/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt +++ b/sonatype/src/test/kotlin/com/bakdata/gradle/SonatypePluginIT.kt @@ -103,12 +103,12 @@ internal class SonatypePluginIT { } val projectName = testProjectDir.fileName.toString() - val expectedUploades = listOf(".jar", ".pom", "-javadoc.jar", "-sources.jar") + val expectedUploads = listOf(".jar", ".pom", "-javadoc.jar", "-sources.jar", ".module") .map { classifier -> "$projectName/$TEST_VERSION/$projectName-$TEST_VERSION$classifier" } .flatMap { baseFile -> listOf(baseFile, "$baseFile.asc") } .plus("$projectName/maven-metadata.xml") - .flatMap { file -> listOf(file, "$file.md5", "$file.sha1") } - assertThat(getUploadedFilesInGroup(wiremock)).containsExactlyInAnyOrderElementsOf(expectedUploades) + .flatMap { file -> listOf(file, "$file.md5", "$file.sha1", "$file.sha256", "$file.sha512") } + assertThat(getUploadedFilesInGroup(wiremock)).containsExactlyInAnyOrderElementsOf(expectedUploads) } private fun getUploadedFilesInGroup(wiremock: WireMockServer): List { @@ -123,7 +123,13 @@ internal class SonatypePluginIT { .willReturn(okJson("""{"data": [{"id": $PROFILE_ID, "name": "${TEST_GROUP}"}]}"""))) wiremock.stubFor(post(urlMatching("/staging/profiles/$PROFILE_ID/start")) .willReturn(okJson("""{"data": {"stagedRepositoryId": $STAGING_ID}}"""))) - wiremock.stubFor(any(urlMatching("/staging/deploy.*")) + wiremock.stubFor(get(urlMatching("/staging/deployByRepositoryId/$STAGING_ID/.*/maven-metadata.xml")) + .willReturn(okXml(""" + + + + """.trimIndent()))) + wiremock.stubFor(put(urlMatching("/staging/deploy.*")) .willReturn(ok())) wiremock.stubFor(get(urlMatching("/staging/profile_repositories/$PROFILE_ID")) .willReturn(okJson("""{"data": [{"type": "open", "repositoryId": "$REPO_ID"}]}"""))) @@ -140,7 +146,6 @@ internal class SonatypePluginIT { .willReturn(okJson("""{"type": "released", "transitioning": false}"""))) } - @Disabled("java.io.EOFException: input contained no data") //FIXME @Test fun testMultiModuleProject(@TempDir testProjectDir: Path, @Wiremock wiremock: WireMockServer) { Files.writeString(testProjectDir.resolve("build.gradle.kts"), """ @@ -201,12 +206,12 @@ internal class SonatypePluginIT { .haveExactly(1, taskWithPathAndOutcome(":closeAndReleaseRepository", TaskOutcome.SUCCESS)) } - val expectedUploades = listOf(".jar", ".pom", "-javadoc.jar", "-sources.jar") + val expectedUploads = listOf(".jar", ".pom", "-javadoc.jar", "-sources.jar", ".module") .flatMap { classifier -> children.map { child -> "$child/$TEST_VERSION/$child-$TEST_VERSION$classifier" } } .flatMap { baseFile -> listOf(baseFile, "$baseFile.asc") } .plus(children.map { child -> "$child/maven-metadata.xml" }) - .flatMap { file -> listOf(file, "$file.md5", "$file.sha1") } - assertThat(getUploadedFilesInGroup(wiremock)).containsExactlyInAnyOrderElementsOf(expectedUploades) + .flatMap { file -> listOf(file, "$file.md5", "$file.sha1", "$file.sha256", "$file.sha512") } + assertThat(getUploadedFilesInGroup(wiremock)).containsExactlyInAnyOrderElementsOf(expectedUploads) } companion object {