`ActiveProfiles` annotation not working on Spock tests

By cozyconemotel

I have an application-TEST.yml file under my classpath and a Spock specification that is annotated as follows.

@SpringBootTest(classes = Application.class)
class GenerateBillingFileServiceTest extends Specification {
  AServiceThatUsesProperties aServiceThatUsesProperties
  def "test" {

I want this injected AServiceThatUsesProperties to use the values in application-TEST.yml. However, this is not the case, and the properties file that is read is the one declared in application.yml as spring.profiles.active: DEVELOPMENT. Doesn’t @ActiveProfies override this value? If it doesn’t, how do you make a Spock specification use a specific properties file?

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273