Skip to content

Instantly share code, notes, and snippets.

@zpapez
Created November 23, 2020 10:31
Show Gist options
  • Save zpapez/6f17246bc5a230c165e7c781c5e1beb7 to your computer and use it in GitHub Desktop.
Save zpapez/6f17246bc5a230c165e7c781c5e1beb7 to your computer and use it in GitHub Desktop.
ContextConfiguration - initializers of properties
class AppIntegrationTestPropertyInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
@Override
public void initialize(ConfigurableApplicationContext applicationContext) {
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(applicationContext,
"zephyr.api.baseUrl="
+ String.format("%s/jira/rest/zapi/latest",
IntegrationTest.zephyrWiremockServer.baseUrl()));
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(applicationContext,
"slack.baseUrl="
+ String.format("%s/api",
IntegrationTest.slackWiremockServer.baseUrl()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment