Closed
Description
Having bootstrap.yml
in the main sources
spring:
application:
name: edgeService
cloud:
consul:
config:
enabled: false
prefix: config
profileSeparator: '@@'
watch:
enabled: false
discovery:
tags: version=@project.version@
host: localhost
port: 8500
main:
banner-mode: 'off'
and having the bootstrap-ci.yml
and @ActiveProfiles("ci")
in the tests
spring:
application:
name: edgeService
cloud:
consul:
discovery:
scheme: http
enabled: false
config:
enabled: false
... (other app-specific configs removed)
stubrunner:
ids: com.acme:security.service:1.0.0:stubs
idsToServiceIds:
security.service: securityService
Doesn't lead to overriding the values from bootstrap.yml
. In other words the app is always trying to connect to Consul.
Related issues:
spring-cloud/spring-cloud-contract#174
spring-cloud/spring-cloud-contract#141
Activity
marcingrzejszczak commentedon Mar 10, 2017
The current workaround for this is to use a static block like this:
spencergibb commentedon Apr 4, 2017
This works in general, so I wonder if it is specific to tests and
@ActiveProfiles
.spencergibb commentedon Apr 4, 2017
hmm, I wrote a test that uses
@ActiveProfiles
with a profile specific bootstrap.yml and it overrides the value just fine.vicusbass commentedon Apr 6, 2017
The workaround specified by Marcin works fine, but if a test fails, the failure reason does not offer any indication on what the problem is, but it points to Hystrix.
vicusbass commentedon May 4, 2017
While using the following versions:
the static block is not needed anymore while having the following configuration in bootstrap.yml:
marcingrzejszczak commentedon May 4, 2017
So we can close it since it got fixed in Dalston.