A help with annotations with Spring Boot

2

A help with annotations ... Today my tests are like this:

@ConfigA
@ConfigB
@ConfigC
@ConfigD
public class MeuTesteA {}

@ConfigA
@ConfigB
@ConfigC
@ConfigD
public class MeuTesteB {}

See, I have to repeat many configuration annotations. To solve, I created an abstract class, getting it this way:

@ConfigA
@ConfigB
@ConfigC
@ConfigD
public abstract class ConfigTeste {}

And the tests went like this. At this point, it works perfectly!

public class MeuTesteA extends ConfigTeste {}
public class MeuTesteB extends ConfigTeste {}

But I still think it's better to improve. I wanted something like this:

@SuperConfig
public class MeuTesteA {}

@SuperConfig
public class MeuTesteA {}

Where my customized annotation @SuperConfig would load all the settings above. I tried to create the "@SuperConfig" like this:

@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@ConfigA
@ConfigB
@ConfigC
@ConfigD
public @interface SuperConfig { 

}

But it did not work. Does not load settings. Do you know where the error is?

PS: The settings are these:

@ActiveProfiles("[UM_AMBIENTE_AQUI]")
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(Application.class)
@IntegrationTest("{server.port:8000, server.address:localhost}")

I'm using Spring Boot in version 1.3.7.RELEASE

Vlw's

    
asked by anonymous 18.05.2018 / 21:45

0 answers