Java Code Examples for org.springframework.boot.test.util.TestPropertyValues#of()
The following examples show how to use
org.springframework.boot.test.util.TestPropertyValues#of() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractUnitTest.java From event-sourcing-microservices-example with GNU General Public License v3.0 | 6 votes |
@Override public void initialize(@NotNull ConfigurableApplicationContext configurableApplicationContext) { String jdbcUrl = String.format("jdbc:postgresql://%s:%d/%s", postgres.getContainerIpAddress(), postgres.getMappedPort(5432), "postgres"); TestPropertyValues values = TestPropertyValues.of( "postgres.host=" + postgres.getContainerIpAddress(), "postgres.port=" + postgres.getMappedPort(5432), "postgres.url=" + jdbcUrl, "postgres.database-name=postgres", "spring.application.name=friend-service", "spring.datasource.data-username=postgres", "spring.datasource.data-password=password", "spring.datasource.url=" + jdbcUrl, "eureka.client.enabled=false"); values.applyTo(configurableApplicationContext); }
Example 2
Source File: AbstractUnitTest.java From event-sourcing-microservices-example with GNU General Public License v3.0 | 6 votes |
@Override public void initialize(@NotNull ConfigurableApplicationContext configurableApplicationContext) { String jdbcUrl = String.format("jdbc:postgresql://%s:%d/%s", postgres.getContainerIpAddress(), postgres.getMappedPort(5432), "postgres"); TestPropertyValues values = TestPropertyValues.of( "postgres.host=" + postgres.getContainerIpAddress(), "postgres.port=" + postgres.getMappedPort(5432), "postgres.url=" + jdbcUrl, "postgres.database-name=postgres", "spring.application.name=user-service", "spring.datasource.data-username=postgres", "spring.datasource.data-password=password", "spring.datasource.url=" + jdbcUrl, "eureka.client.enabled=false"); values.applyTo(configurableApplicationContext); }
Example 3
Source File: GetPersonByIdIT.java From blog-tutorials with MIT License | 5 votes |
@Override public void initialize(ConfigurableApplicationContext configurableApplicationContext) { TestPropertyValues values = TestPropertyValues.of( "spring.datasource.url=" + postgreSQLContainer.getJdbcUrl(), "spring.datasource.password=" + postgreSQLContainer.getPassword(), "spring.datasource.username=" + postgreSQLContainer.getUsername() ); values.applyTo(configurableApplicationContext); }
Example 4
Source File: GetAllPersonsIT.java From blog-tutorials with MIT License | 5 votes |
@Override public void initialize(ConfigurableApplicationContext configurableApplicationContext) { TestPropertyValues values = TestPropertyValues.of( "spring.datasource.url=" + postgreSQLContainer.getJdbcUrl(), "spring.datasource.password=" + postgreSQLContainer.getPassword(), "spring.datasource.username=" + postgreSQLContainer.getUsername() ); values.applyTo(configurableApplicationContext); }
Example 5
Source File: DeletePersonIT.java From blog-tutorials with MIT License | 5 votes |
@Override public void initialize(ConfigurableApplicationContext configurableApplicationContext) { TestPropertyValues values = TestPropertyValues.of( "spring.datasource.url=" + postgreSQLContainer.getJdbcUrl(), "spring.datasource.password=" + postgreSQLContainer.getPassword(), "spring.datasource.username=" + postgreSQLContainer.getUsername() ); values.applyTo(configurableApplicationContext); }
Example 6
Source File: ZipkinForwarderTest.java From pitchfork with Apache License 2.0 | 5 votes |
public void initialize(ConfigurableApplicationContext context) { var values = TestPropertyValues.of( "pitchfork.forwarders.zipkin.http.enabled=true", "pitchfork.forwarders.zipkin.http.endpoint=http://" + zipkinContainer.getContainerIpAddress() + ":" + zipkinContainer .getFirstMappedPort() + "/api/v2/spans" ); values.applyTo(context); }
Example 7
Source File: RabbitMqIngressTest.java From pitchfork with Apache License 2.0 | 5 votes |
public void initialize(ConfigurableApplicationContext context) { var values = TestPropertyValues.of( "pitchfork.ingress.rabbitmq.enabled=true", "pitchfork.ingress.rabbitmq.host=" + rabbitMqContainer.getContainerIpAddress(), "pitchfork.ingress.rabbitmq.port=" + rabbitMqContainer.getFirstMappedPort(), "pitchfork.ingress.rabbitmq.queue-name=zipkin", "pitchfork.ingress.rabbitmq.source-format=PROTO3", "pitchfork.forwarders.haystack.kafka.enabled=true", "pitchfork.forwarders.haystack.kafka.bootstrap-servers=" + kafkaContainer.getBootstrapServers() ); values.applyTo(context); }
Example 8
Source File: KafkaIngressTest.java From pitchfork with Apache License 2.0 | 5 votes |
public void initialize(ConfigurableApplicationContext context) { var values = TestPropertyValues.of( "pitchfork.ingress.kafka.enabled=true", "pitchfork.ingress.kafka.bootstrap-servers=" + kafkaContainer.getBootstrapServers(), "pitchfork.ingress.kafka.source-format=PROTO3", "pitchfork.forwarders.haystack.kafka.enabled=true", "pitchfork.forwarders.haystack.kafka.bootstrap-servers=" + kafkaContainer.getBootstrapServers() ); values.applyTo(context); }
Example 9
Source File: HaystackKinesisForwarderTest.java From pitchfork with Apache License 2.0 | 5 votes |
public void initialize(ConfigurableApplicationContext context) { var values = TestPropertyValues.of( "pitchfork.forwarders.haystack.kinesis.enabled=true", "pitchfork.forwarders.haystack.kinesis.auth.config-type=BASIC", "pitchfork.forwarders.haystack.kinesis.client.config-type=ENDPOINT", "pitchfork.forwarders.haystack.kinesis.client.endpoint.service-endpoint=" + KINESIS_SERVICE_ENDPOINT ); values.applyTo(context); }
Example 10
Source File: HaystackKafkaForwarderTest.java From pitchfork with Apache License 2.0 | 5 votes |
public void initialize(ConfigurableApplicationContext context) { var values = TestPropertyValues.of( "pitchfork.forwarders.haystack.kafka.enabled=true", "pitchfork.forwarders.haystack.kafka.bootstrap-servers=" + kafkaContainer.getBootstrapServers() ); values.applyTo(context); }
Example 11
Source File: LicenseAcceptedMSSQLServerContainer.java From infobip-spring-data-querydsl with Apache License 2.0 | 5 votes |
@Override public void initialize(ConfigurableApplicationContext applicationContext) { INSTANCE.start(); String url = applicationContext.getEnvironment() .getProperty("spring.datasource.url") .replace("<port>", INSTANCE.getMappedPort(MS_SQL_SERVER_PORT).toString()); TestPropertyValues values = TestPropertyValues.of( "spring.datasource.url=" + url); values.applyTo(applicationContext); DatabaseCreator creator = new DatabaseCreator(url, INSTANCE.getUsername(), INSTANCE.getPassword()); creator.createDatabaseIfItDoesntExist(); }
Example 12
Source File: AbstractIntegrationTest.java From event-sourcing-microservices-example with GNU General Public License v3.0 | 5 votes |
@Override public void initialize(@NotNull ConfigurableApplicationContext configurableApplicationContext) { String jdbcUrl = String.format("jdbc:postgresql://%s:%d/%s", postgres.getContainerIpAddress(), postgres.getMappedPort(5432), "postgres"); TestPropertyValues values = TestPropertyValues.of( "postgres.host=" + postgres.getContainerIpAddress(), "postgres.port=" + postgres.getMappedPort(5432), "postgres.url=" + jdbcUrl, "spring.datasource.url=" + jdbcUrl, "spring.cloud.stream.kafka.binder.brokers=" + kafka.getBootstrapServers(), "eureka.client.enabled=false"); values.applyTo(configurableApplicationContext); }
Example 13
Source File: AbstractIntegrationTest.java From event-sourcing-microservices-example with GNU General Public License v3.0 | 5 votes |
@Override public void initialize(@NotNull ConfigurableApplicationContext configurableApplicationContext) { String jdbcUrl = String.format("jdbc:postgresql://%s:%d/%s", postgres.getContainerIpAddress(), postgres.getMappedPort(5432), "postgres"); TestPropertyValues values = TestPropertyValues.of( "postgres.host=" + postgres.getContainerIpAddress(), "postgres.port=" + postgres.getMappedPort(5432), "postgres.url=" + jdbcUrl, "spring.datasource.url=" + jdbcUrl, "spring.cloud.stream.kafka.binder.brokers=" + kafka.getBootstrapServers(), "eureka.client.enabled=false"); values.applyTo(configurableApplicationContext); }
Example 14
Source File: TimestampTaskPropertiesTests.java From spring-cloud-task with Apache License 2.0 | 5 votes |
@Test(expected = IllegalArgumentException.class) public void testEmptyFormat() { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); TestPropertyValues testPropertyValues = TestPropertyValues.of("format:"); testPropertyValues.applyTo(context); context.register(Conf.class); context.refresh(); TimestampTaskProperties properties = context .getBean(TimestampTaskProperties.class); properties.getFormat(); }