Merge branch 'ft/JD-678' into sahgdkjasd

# Conflicts:
#	src/test/java/com/rbkmoney/wb/list/manager/RiakTest.java
#	src/test/java/com/rbkmoney/wb/list/manager/WbListManagerApplicationTest.java
#	src/test/java/com/rbkmoney/wb/list/manager/extension/RiakContainerExtension.java
This commit is contained in:
ggmaleva 2021-09-30 18:49:44 +03:00
commit e5ee0d360f
No known key found for this signature in database
GPG Key ID: 0E412B78565B108F
2 changed files with 37 additions and 1 deletions

View File

@ -37,7 +37,7 @@ public class RiakTest {
private RiakClient client;
@Test
public void riakTest() throws ExecutionException, InterruptedException {
void riakTest() throws ExecutionException, InterruptedException {
sleep(20000);
Row row = new Row();

View File

@ -0,0 +1,36 @@
package com.rbkmoney.wb.list.manager.extension;
import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.WaitAllStrategy;
import java.time.Duration;
import java.util.UUID;
public class RiakContainerExtension implements BeforeAllCallback, AfterAllCallback {
private GenericContainer riak;
@Override
public void beforeAll(ExtensionContext extensionContext) throws Exception {
riak = new GenericContainer("basho/riak-kv")
.withExposedPorts(8098, 8087)
.withPrivilegedMode(true)
.withNetworkAliases("riak-kv-" + UUID.randomUUID())
.withEnv("CLUSTER_NAME", "riakts")
.withEnv("WAIT_FOR_ERLANG", "1000")
.withLabel("com.basho.riak.cluster.name", "riakts")
.waitingFor(new WaitAllStrategy()
.withStartupTimeout(Duration.ofMinutes(2)));
riak.start();
System.setProperty("riak.port", String.valueOf(riak.getMappedPort(8087)));
}
@Override
public void afterAll(ExtensionContext extensionContext) throws Exception {
riak.stop();
}
}