You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using this plugin for my project (Spring Boot App), I like this very much.
I'm writing some test cases around to make sure the plugin is working as expected , notice that the below test always returns success.
if I do not set gitPropertiesPluginExtension.failOnNoGitDirectory = true which is the default behavior , then also I see same result and if I set explicitly also I see the same behavior.
expected behavior is to catch the exception and run those asserts as there is no .git directly by default in my src/test/resources/git-properties-plugin folder.
I'm using Spring Boot 3.3.5
Gradle : 8.10.2
Java 21.
Kotlin JVM : 1.9.0
@Test
fun testPluginFailsWithoutGitDirectoryAndFailOnNoGitDirectoryTrue() {
val projectDir = File("src/test/resources/git-properties-plugin")
val project = ProjectBuilder.builder().withProjectDir(projectDir).build()
project.pluginManager.apply(GitPropertiesPlugin::class.java)
try {
val gitPropertiesPluginExtension = project.extensions.getByType(GitPropertiesPluginExtension::class.java)
gitPropertiesPluginExtension.failOnNoGitDirectory = true
val gitPropertiesTask = project.tasks.getByName("generateGitProperties") as GenerateGitPropertiesTask
gitPropertiesTask.generate()
} catch (e: Exception) {
assertEquals(GradleException::class.java, e::class.java)
assertEquals("No Git repository found.", e.message)
}
//cleanUp(projectDir)
}
Thanks.
The text was updated successfully, but these errors were encountered:
Greetings,
I'm using this plugin for my project (Spring Boot App), I like this very much.
I'm writing some test cases around to make sure the plugin is working as expected , notice that the below test always returns success.
if I do not set
gitPropertiesPluginExtension.failOnNoGitDirectory = true
which is the default behavior , then also I see same result and if I set explicitly also I see the same behavior.expected behavior is to catch the exception and run those asserts as there is no
.git
directly by default in mysrc/test/resources/git-properties-plugin
folder.I'm using Spring Boot 3.3.5
Gradle : 8.10.2
Java 21.
Kotlin JVM : 1.9.0
Thanks.
The text was updated successfully, but these errors were encountered: