-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Quarkus Gradle Plugin: tests with encrypted configuration
As decribed in #33135, using encrypted configuration values did not work with the Gradle plugin since Quarkus 3.0.0, prior to SmallRye Config 3.3.0 (#33079). This change just adds tests to validate the behavior.
- Loading branch information
Showing
6 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...dle/gradle-application-plugin/src/test/java/io/quarkus/gradle/tasks/CryptoConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package io.quarkus.gradle.tasks; | ||
|
||
import java.io.File; | ||
import java.net.URL; | ||
import java.nio.file.Path; | ||
|
||
import org.apache.commons.io.FileUtils; | ||
import org.gradle.testkit.runner.GradleRunner; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.io.TempDir; | ||
|
||
public class CryptoConfigTest { | ||
|
||
@TempDir | ||
Path testProjectDir; | ||
|
||
@Test | ||
void smallryeCrypto() throws Exception { | ||
URL url = getClass().getClassLoader().getResource("io/quarkus/gradle/tasks/crypto/main"); | ||
FileUtils.copyDirectory(new File(url.toURI()), testProjectDir.toFile()); | ||
FileUtils.copyFile(new File("../gradle.properties"), testProjectDir.resolve("gradle.properties").toFile()); | ||
|
||
GradleRunner.create() | ||
.withPluginClasspath() | ||
.withProjectDir(testProjectDir.toFile()) | ||
.withArguments("build", "--info", "--stacktrace", "--build-cache", "--configuration-cache") | ||
// .build() checks whether the build failed, which is good enough for this test | ||
.build(); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...pplication-plugin/src/test/resources/io/quarkus/gradle/tasks/crypto/main/build.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
plugins { | ||
java | ||
id("io.quarkus") | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation(enforcedPlatform("io.quarkus:quarkus-bom:${project.property("version")}")) | ||
implementation("jakarta.inject:jakarta.inject-api:2.0.1") | ||
} |
1 change: 1 addition & 0 deletions
1
...ication-plugin/src/test/resources/io/quarkus/gradle/tasks/crypto/main/settings.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = "gradle-build-caching" |
4 changes: 4 additions & 0 deletions
4
...in/src/test/resources/io/quarkus/gradle/tasks/crypto/main/src/main/java/org/acme/Foo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package org.acme; | ||
|
||
public class Foo { | ||
} |
1 change: 1 addition & 0 deletions
1
...t/resources/io/quarkus/gradle/tasks/crypto/main/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
someValue = ${aes-gcm-nopadding::superSecret} |