0

I have a test class annotated with

@SpringBootTest.
@ActiveProfiles("default")

There was originally a bootstrap.yml file with the following contents

spring:
  application:
    name: [insert name]
  cloud:
    config:
      enabled: false
    vault:
      enabled: false

I would like to move the contents of bootstrap.yml into application-default.yml and delete bootstrap.yml, but this causes the tests to fail. Is this something that is possible?

Tony
  • 1
  • 2

1 Answers1

0

Try to use this annotation:

@TestPropertySource(locations = "classpath:application-default.yml")

Just make sure that your application-default.yml is on resource paste.

edit: take a look https://stackoverflow.com/a/26840503/11329776

Victor Pietro
  • 21
  • 1
  • 6