Skip to content

Commit

Permalink
Merge pull request #103 from avaje/feature/test-native-image-profiles
Browse files Browse the repository at this point in the history
test for native image using avaje.profiles (via system property)
  • Loading branch information
rob-bygrave authored Oct 17, 2023
2 parents c68ff34 + 2c6d548 commit 0fde84f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/native-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
mvn clean install -DskipTests
cd tests/test-native-image
mvn clean package -Pnative
./target/test-native
./target/test-native -Davaje.profiles=admin
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
{
"resources": [
{
"pattern": "application.properties"
"pattern": "application.*properties"
},
{
"pattern": "application.yaml"
"pattern": "application.*yaml"
},
{
"pattern": "application.yml"
},
{
"pattern": "application-*.properties"
},
{
"pattern": "application-*.yaml"
},
{
"pattern": "application-*.yml"
"pattern": "application.*yml"
}
]
}
9 changes: 7 additions & 2 deletions tests/test-native-image/src/main/java/org/example/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
public class Main {

public static void main(String[] args) {
String val = Config.get("hello.world", "not-set");
System.out.println("Hello - " + val);
// System.getProperties().list(System.out);
// System.out.println("---");
String profiles = System.getProperty("avaje.profiles");
System.out.println("avaje.profiles=" + profiles);
System.out.println("hello.world - " + Config.get("hello.world", "not-set"));
System.out.println("admin - " + Config.get("admin", "not-set"));
System.out.println("common - " + Config.get("common", "not-set"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
common=From-application-admin.properties
admin=InAdmin
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
hello.world=Rob
common=From-application.properties

0 comments on commit 0fde84f

Please sign in to comment.