(disabledWithoutDocker Alanı
Örnek
Şöyle yaparız
@SpringBootTest@TestContainers(disabledWithoutDocker = true)@ContextConfiguration(initializers = ExampleIntegrationTests.Initializer.class)class ExampleIntegrationTests {@Containerpublic static CassandraContainer<?> cassandra = new CassandraContainer<>();static class Initializerimplements ApplicationContextInitializer<ConfigurableApplicationContext> {@Overridepublic void initialize(ConfigurableApplicationContext context) {int cqlPort = cassandra.getMappedPort(CassandraContainer.CQL_PORT);TestPropertyValues.of("spring.data.cassandra.port="+ cqlPort).applyTo(context.getEnvironment());}}}
Hiç yorum yok:
Yorum Gönder