public abstract class AbstractIntegrationTest { @ClassRule public static PostgreSQLContainer postgreSql = new PostgreSQLContainer(); @ClassRule public static GenericContainer redis = new GenericContainer("redis:3.0.6") .withExposedPorts(6379); @ClassRule public static MockServerContainer mockServer = new MockServerContainer(); public static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> { @Override public void initialize(ConfigurableApplicationContext configurableApplicationContext) { EnvironmentTestUtils.addEnvironment(configurableApplicationContext, "spring.database.url=" + postgreSql.getJdbcUrl(), "spring.database.username=" + postgreSql.getUsername(), "spring.database.password=" + postgreSql.getPassword(), "spring.redis.host=" + redis.getContainerIpAddress(), "spring.redis.port=" + redis.getMappedPort(6379), "spring.redis.port=" + mockServer.getContainerIpAddress() + ":" + mockServer.getMappedPort(8080) ); } } } Still using all the Spring goodies!