-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathIntegrationTestBase.java
More file actions
52 lines (45 loc) · 1.92 KB
/
IntegrationTestBase.java
File metadata and controls
52 lines (45 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Copyright (c) 2020-2022 - for information on the respective copyright owner
* see the NOTICE file and/or the repository at
* https://github.com/hyperledger-labs/acapy-java-client
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.hyperledger.aries;
import org.junit.jupiter.api.BeforeEach;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
@Testcontainers
public abstract class IntegrationTestBase {
private final Logger log = LoggerFactory.getLogger(IntegrationTestBase.class);
public static final String ARIES_VERSION = "bcgovimages/aries-cloudagent:py36-1.16-1_0.7.3";
public static final Integer ARIES_ENDPOINT_PORT = 8030;
public static final Integer ARIES_ADMIN_PORT = 8031;
protected AriesClient ac;
@Container
protected GenericContainer<?> ariesContainer = new GenericContainer<>(ARIES_VERSION)
.withExposedPorts(ARIES_ADMIN_PORT)
.withCommand("start"
+ " -it http 0.0.0.0 " + ARIES_ENDPOINT_PORT
+ " -ot http --admin 0.0.0.0 " + ARIES_ADMIN_PORT
+ " --admin-insecure-mode"
+ " --log-level debug"
+ " -e http://0.0.0.0"
+ " --no-ledger"
+ " --auto-disclose-features"
+ " --plugin aries_cloudagent.messaging.jsonld")
.waitingFor(Wait.defaultWaitStrategy())
.withLogConsumer(new Slf4jLogConsumer(log))
;
@BeforeEach
void setup() {
ac = AriesClient.builder()
.url("http://localhost:" + ariesContainer.getMappedPort(ARIES_ADMIN_PORT))
.build();
}
}