Skip to content

Commit

Permalink
#1001 Add integration test for property bootstrapping in Launchpad ap…
Browse files Browse the repository at this point in the history
…plications
  • Loading branch information
GuusLieben committed Dec 23, 2024
1 parent 8215215 commit 1a03511
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
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));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hartshorn:
test:
additional-config: true

0 comments on commit 1a03511

Please sign in to comment.