BJ-314: fix

This commit is contained in:
a.karlov 2018-12-04 18:47:17 +03:00
parent 844f1aad6b
commit b3e10fecb3
2 changed files with 22 additions and 18 deletions

View File

@ -26,7 +26,7 @@
<dockerfile.base.service.tag>22c57470c4fc47161894f036b7cf9d70f42b75f5</dockerfile.base.service.tag>
<shared.resources.version>0.2.1</shared.resources.version>
<woody.thrift.version>1.1.15</woody.thrift.version>
<file.storage.proto.version>1.8-c23437f</file.storage.proto.version>
<file.storage.proto.version>1.10-f44896e</file.storage.proto.version>
<geck.version>0.6.8</geck.version>
<swagger.version>2.8.0</swagger.version>
</properties>

View File

@ -2,6 +2,7 @@ package com.rbkmoney.file.storage;
import com.rbkmoney.woody.thrift.impl.http.THSpawnClientBuilder;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.util.EnvironmentTestUtils;
@ -11,12 +12,15 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.HttpWaitStrategy;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
@ -42,21 +46,21 @@ public abstract class AbstractIntegrationTest {
protected FileStorageSrv.Iface client;
// @ClassRule
// public static GenericContainer cephContainer = new GenericContainer("dr.rbkmoney.com/ceph-demo:latest")
// .withEnv("RGW_NAME", "localhost")
// .withEnv("NETWORK_AUTO_DETECT", "4")
// .withEnv("CEPH_DEMO_UID", "ceph-test")
// .withEnv("CEPH_DEMO_ACCESS_KEY", AWS_ACCESS_KEY)
// .withEnv("CEPH_DEMO_SECRET_KEY", AWS_SECRET_KEY)
// .withEnv("CEPH_DEMO_BUCKET", BUCKET_NAME)
// .withExposedPorts(5000, 80)
// .waitingFor(
// new HttpWaitStrategy()
// .forPath("/api/v0.1/health")
// .forStatusCode(200)
// .withStartupTimeout(Duration.ofMinutes(10))
// );
@ClassRule
public static GenericContainer cephContainer = new GenericContainer("dr.rbkmoney.com/ceph-demo:latest")
.withEnv("RGW_NAME", "localhost")
.withEnv("NETWORK_AUTO_DETECT", "4")
.withEnv("CEPH_DEMO_UID", "ceph-test")
.withEnv("CEPH_DEMO_ACCESS_KEY", AWS_ACCESS_KEY)
.withEnv("CEPH_DEMO_SECRET_KEY", AWS_SECRET_KEY)
.withEnv("CEPH_DEMO_BUCKET", BUCKET_NAME)
.withExposedPorts(5000, 80)
.waitingFor(
new HttpWaitStrategy()
.forPath("/api/v0.1/health")
.forStatusCode(200)
.withStartupTimeout(Duration.ofMinutes(10))
);
public static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
@Override
@ -64,9 +68,9 @@ public abstract class AbstractIntegrationTest {
EnvironmentTestUtils.addEnvironment(
"testcontainers",
configurableApplicationContext.getEnvironment(),
// "storage.endpoint=" + cephContainer.getContainerIpAddress() + ":" + cephContainer.getMappedPort(80),
"storage.endpoint=" + cephContainer.getContainerIpAddress() + ":" + cephContainer.getMappedPort(80),
// в случае, если поднят локальный сторедж в контейнере
"storage.endpoint=localhost:32827",
//"storage.endpoint=localhost:32827",
"storage.signingRegion=" + SIGNING_REGION,
"storage.accessKey=" + AWS_ACCESS_KEY,
"storage.secretKey=" + AWS_SECRET_KEY,