Skip to content

Commit

Permalink
Upgrade to Gradle 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Mar 11, 2024
1 parent c153875 commit 6574b99
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
18 changes: 9 additions & 9 deletions release/src/test/kotlin/com/bakdata/gradle/ReleasePluginTest.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The MIT License
* MIT License
*
* Copyright (c) 2024 bakdata GmbH
*
Expand Down Expand Up @@ -31,8 +31,7 @@ import com.bakdata.gradle.ReleasePlugin.Companion.REQUIRE_BRANCH
import com.bakdata.gradle.ReleasePlugin.Companion.SINCE_TAG
import net.researchgate.release.ReleaseExtension
import net.researchgate.release.ReleasePlugin
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.assertThatCode
import org.assertj.core.api.Assertions.*
import org.assertj.core.api.Condition
import org.assertj.core.api.SoftAssertions
import org.gradle.api.Project
Expand All @@ -43,6 +42,7 @@ import org.gradle.testfixtures.ProjectBuilder
import org.hildan.github.changelog.plugin.GitHubChangelogExtension
import org.hildan.github.changelog.plugin.GitHubChangelogPlugin
import org.junit.jupiter.api.Test
import java.util.function.Consumer

internal class ReleasePluginTest {

Expand All @@ -64,16 +64,16 @@ internal class ReleasePluginTest {
.haveExactly(1, Condition({ it is ReleasePlugin }, "Has release plugin"))
.haveExactly(1, Condition({ it is GitHubChangelogPlugin }, "Has changelog plugin"))
softly.assertThat(project.extensions.findByType<ReleaseExtension>()?.git)
.satisfies {
.satisfies(Consumer {
softly.assertThat(it?.pushToRemote?.get()).isEqualTo("origin")
softly.assertThat(it?.requireBranch?.get()).isEqualTo("main")
}
})
softly.assertThat(project.extensions.findByType<GitHubChangelogExtension>())
.satisfies {
.satisfies(Consumer {
softly.assertThat(it?.githubRepository).isNull()
softly.assertThat(it?.futureVersionTag).isNull()
softly.assertThat(it?.sinceTag).isNull()
}
})
}
}

Expand Down Expand Up @@ -178,7 +178,7 @@ internal class ReleasePluginTest {
val parent = ProjectBuilder.builder().withName("parent").build()
val child1 = ProjectBuilder.builder().withName("child1").withParent(parent).build()

assertThatCode { child1.pluginManager.apply("com.bakdata.release") }
.satisfies { assertThat(it.cause).hasMessageContaining("top-level project") }
assertThatThrownBy { child1.pluginManager.apply("com.bakdata.release") }
.satisfies(Consumer { assertThat(it.cause).hasMessageContaining("top-level project") })
}
}
9 changes: 5 additions & 4 deletions sonar/src/test/kotlin/com/bakdata/gradle/SonarPluginTest.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The MIT License
* MIT License
*
* Copyright (c) 2024 bakdata GmbH
*
Expand All @@ -26,14 +26,15 @@ package com.bakdata.gradle

import org.assertj.core.api.Assertions
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.assertThatCode
import org.assertj.core.api.Assertions.assertThatThrownBy
import org.assertj.core.api.Condition
import org.assertj.core.api.SoftAssertions
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.internal.project.DefaultProject
import org.gradle.testfixtures.ProjectBuilder
import org.junit.jupiter.api.Test
import java.util.function.Consumer

internal class SonarPluginTest {
fun taskWithName(name: String): Condition<Task> = Condition({ it.name == name }, "Task with name $name")
Expand Down Expand Up @@ -137,7 +138,7 @@ internal class SonarPluginTest {
val parent = ProjectBuilder.builder().withName("parent").build()
val child1 = ProjectBuilder.builder().withName("child1").withParent(parent).build()

assertThatCode { child1.pluginManager.apply("com.bakdata.sonar") }
.satisfies { assertThat(it.cause).hasMessageContaining("top-level project") }
assertThatThrownBy { child1.pluginManager.apply("com.bakdata.sonar") }
.satisfies(Consumer { assertThat(it.cause).hasMessageContaining("top-level project") })
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* The MIT License
* MIT License
*
* Copyright (c) 2024 bakdata GmbH
*
Expand Down Expand Up @@ -34,6 +34,7 @@ import org.gradle.testfixtures.ProjectBuilder
import org.junit.jupiter.api.Test
import java.io.File
import java.nio.file.Files
import java.util.function.Consumer


internal class SonatypePluginTest {
Expand Down Expand Up @@ -112,8 +113,8 @@ internal class SonatypePluginTest {
val parent = ProjectBuilder.builder().withName("parent").build()
val child1 = ProjectBuilder.builder().withName("child1").withParent(parent).build()

Assertions.assertThatCode { child1.apply(plugin = "com.bakdata.sonatype") }
.satisfies { Assertions.assertThat(it.cause).hasMessageContaining("top-level project") }
Assertions.assertThatThrownBy { child1.apply(plugin = "com.bakdata.sonatype") }
.satisfies(Consumer { Assertions.assertThat(it.cause).hasMessageContaining("top-level project") })
}

}
Expand Down

0 comments on commit 6574b99

Please sign in to comment.