类org.springframework.test.context.DynamicPropertySource源码实例Demo

下面列出了怎么用org.springframework.test.context.DynamicPropertySource的API类实例代码及写法,或者点击链接到github查看源代码。

@DynamicPropertySource
static void resgiterDynamicProperties(DynamicPropertyRegistry registry) {
    registry.add("spring.r2dbc.url", () -> "r2dbc:postgresql://"
            + postgreSQLContainer.getHost() + ":" + postgreSQLContainer.getFirstMappedPort()
            + "/" + postgreSQLContainer.getDatabaseName());
    registry.add("spring.r2dbc.username", () -> postgreSQLContainer.getUsername());
    registry.add("spring.r2dbc.password", () -> postgreSQLContainer.getPassword());
}
 
源代码2 项目: sdn-rx   文件: ReactiveWebApplicationTest.java
@DynamicPropertySource
static void neo4jProperties(DynamicPropertyRegistry registry) {
	registry.add("org.neo4j.driver.uri", neo4jContainer::getBoltUrl);
	registry.add("org.neo4j.driver.authentication.username", () -> "neo4j");
	registry.add("org.neo4j.driver.authentication.password", neo4jContainer::getAdminPassword);
}
 
源代码3 项目: sdn-rx   文件: ReactiveTemplateExampleTest.java
@DynamicPropertySource
static void neo4jProperties(DynamicPropertyRegistry registry) {
	registry.add("org.neo4j.driver.uri", neo4jContainer::getBoltUrl);
	registry.add("org.neo4j.driver.authentication.username", () -> "neo4j");
	registry.add("org.neo4j.driver.authentication.password", neo4jContainer::getAdminPassword);
}
 
源代码4 项目: sdn-rx   文件: RepositoryIT.java
@DynamicPropertySource
static void neo4jProperties(DynamicPropertyRegistry registry) {
	registry.add("org.neo4j.driver.uri", neo4jContainer::getBoltUrl);
	registry.add("org.neo4j.driver.authentication.username", () -> "neo4j");
	registry.add("org.neo4j.driver.authentication.password", neo4jContainer::getAdminPassword);
}
 
源代码5 项目: blog-tutorials   文件: ThirdApplicationIT.java
@DynamicPropertySource
static void datasourceConfig(DynamicPropertyRegistry registry) {
  registry.add("spring.datasource.url", postgreSQLContainer::getJdbcUrl);
  registry.add("spring.datasource.password", postgreSQLContainer::getPassword);
  registry.add("spring.datasource.username", postgreSQLContainer::getUsername);
}
 
源代码6 项目: blog-tutorials   文件: BaseIT.java
@DynamicPropertySource
static void datasourceConfig(DynamicPropertyRegistry registry) {
  registry.add("spring.datasource.url", postgreSQLContainer::getJdbcUrl);
  registry.add("spring.datasource.password", postgreSQLContainer::getPassword);
  registry.add("spring.datasource.username", postgreSQLContainer::getUsername);
}
 
源代码7 项目: blog-tutorials   文件: ApplicationIT.java
@DynamicPropertySource
static void postgresqlProperties(DynamicPropertyRegistry registry) {
  registry.add("spring.datasource.url", postgreSQLContainer::getJdbcUrl);
  registry.add("spring.datasource.password", postgreSQLContainer::getPassword);
  registry.add("spring.datasource.username", postgreSQLContainer::getUsername);
}
 
源代码8 项目: blog-tutorials   文件: CreatePersonIT.java
@DynamicPropertySource
static void postgresqlProperties(DynamicPropertyRegistry registry) {
  registry.add("spring.datasource.url", postgreSQLContainer::getJdbcUrl);
  registry.add("spring.datasource.password", postgreSQLContainer::getPassword);
  registry.add("spring.datasource.username", postgreSQLContainer::getUsername);
}
 
@DynamicPropertySource
static void neo4jProperties(DynamicPropertyRegistry registry) {
    registry.add("org.neo4j.driver.uri", neo4jContainer::getBoltUrl);
    registry.add("org.neo4j.driver.authentication.username", () -> "neo4j");
    registry.add("org.neo4j.driver.authentication.password", neo4jContainer::getAdminPassword);
}
 
@DynamicPropertySource
static void redisProperties(DynamicPropertyRegistry registry) {
    redis.start();
    registry.add("spring.redis.host", redis::getContainerIpAddress);
    registry.add("spring.redis.port", redis::getFirstMappedPort);
}
 
 同包方法