mirror of
https://github.com/valitydev/wb-list-manager.git
synced 2024-11-06 01:35:17 +00:00
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:
commit
e5ee0d360f
@ -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();
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user