-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1001 Add integration test for property bootstrapping in Launchpad ap…
…plications
- Loading branch information
1 parent
8215215
commit 1a03511
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...integration-test/java/test/org/dockbox/hartshorn/properties/PropertiesBootstrapTests.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,26 @@ | ||
package test.org.dockbox.hartshorn.properties; | ||
|
||
import org.dockbox.hartshorn.inject.annotations.Inject; | ||
import org.dockbox.hartshorn.launchpad.environment.ApplicationEnvironment; | ||
import org.dockbox.hartshorn.launchpad.properties.PropertiesSource; | ||
import org.dockbox.hartshorn.properties.PropertyRegistry; | ||
import org.dockbox.hartshorn.properties.value.StandardValuePropertyParsers; | ||
import org.dockbox.hartshorn.test.junit.HartshornIntegrationTest; | ||
import org.dockbox.hartshorn.util.option.Option; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
@PropertiesSource("classpath:it-additional-config.yml") | ||
@HartshornIntegrationTest | ||
public class PropertiesBootstrapTests { | ||
|
||
@Test | ||
void testConfigurationWasLoaded(@Inject ApplicationEnvironment environment) { | ||
PropertyRegistry propertyRegistry = environment.propertyRegistry(); | ||
Option<Boolean> isAdditionalConfigPresent = propertyRegistry.value( | ||
"hartshorn.test.additional-config", | ||
StandardValuePropertyParsers.BOOLEAN | ||
); | ||
Assertions.assertTrue(isAdditionalConfigPresent.orElse(false)); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
hartshorn-integration-tests/src/integration-test/resources/it-additional-config.yml
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,3 @@ | ||
hartshorn: | ||
test: | ||
additional-config: true |