At this moment I have the following feature class:
@ContextConfiguration(classes = MainApplication.class, loader = SpringApplicationContextLoader.class)
@IntegrationTest
@WebAppConfiguration
public abstract class AbstractFeature {
protected RestTemplate restTemplate = new TestRestTemplate();
@Value("${testing.server}")
protected String url;
public URI getURI(String endpoint) {
return URI.create("http://" + url + endpoint);
}
}
which is the base for all my feature classes, using spring boot and cucumber-jvm. Here I also execute a local server in order to test against it.
Is it possible that, based on spring profiles [remote, local], I execute a local server only if the "local" profile is active? Maybe using some sort of dependency injection?
With my current implementation using the provided annotations, the local server is always executed, even on the "remote" profile, where I change the testing.server url to a remote one, using a configuration file.