Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
david0 committed Oct 18, 2024
1 parent 196cc72 commit 560441a
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,33 @@ class GenerateTaskDslTest : TestBase() {
)
}

@Test
fun `promo banner should not be shown when run as quiet`() {
// Arrange
val projectFiles = mapOf(
"spec.yaml" to javaClass.classLoader.getResourceAsStream("specs/petstore-v3.0.yaml")
)
withProject(defaultBuildGradle, projectFiles)

// Act
val result = GradleRunner.create()
.withProjectDir(temp)
.withArguments("openApiGenerate", "--quiet")
.withPluginClasspath()
.build()

// Assert
assertFalse (
result.output.contains("# Thanks for using OpenAPI Generator."),
"Promo banner is shown even when run with --quiet."
)

assertEquals(
TaskOutcome.SUCCESS, result.task(":openApiGenerate")?.outcome,
"Expected a successful run, but found ${result.task(":openApiGenerate")?.outcome}"
)
}

@Test
fun `openApiGenerate should cleanup outputDir`() {
// Arrange
Expand Down

0 comments on commit 560441a

Please sign in to comment.