Skip to content

Commit ed84dd3

Browse files
authored
Bump testcontainers to 2.0.2 (#121)
1 parent 5fd7790 commit ed84dd3

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.scalecube</groupId>
77
<artifactId>scalecube-parent</artifactId>
8-
<version>0.3.14</version>
8+
<version>0.3.16</version>
99
</parent>
1010

1111
<artifactId>scalecube-security-parent</artifactId>
@@ -56,7 +56,7 @@
5656
</dependency>
5757
<dependency>
5858
<groupId>org.testcontainers</groupId>
59-
<artifactId>vault</artifactId>
59+
<artifactId>testcontainers-vault</artifactId>
6060
<scope>test</scope>
6161
</dependency>
6262
</dependencies>

tests/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
<version>${project.parent.version}</version>
2424
</dependency>
2525
<!-- Tests -->
26-
<dependency>
27-
<groupId>org.testcontainers</groupId>
28-
<artifactId>vault</artifactId>
29-
<scope>test</scope>
30-
</dependency>
3126
<dependency>
3227
<groupId>com.bettercloud</groupId>
3328
<artifactId>vault-java-driver</artifactId>

tests/src/test/java/io/scalecube/security/environment/VaultEnvironment.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.scalecube.security.environment;
22

3-
import static org.testcontainers.shaded.org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
4-
import static org.testcontainers.shaded.org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
3+
import static org.apache.commons.lang3.RandomStringUtils.secure;
54

65
import com.bettercloud.vault.json.Json;
76
import com.bettercloud.vault.rest.Rest;
@@ -92,8 +91,8 @@ public void createIdentityTokenPolicy(String roleName) {
9291

9392
public String login() {
9493
try {
95-
String username = randomAlphabetic(5);
96-
String policy = randomAlphanumeric(10);
94+
String username = secure().nextAlphabetic(5);
95+
String policy = secure().nextAlphabetic(10);
9796

9897
// add policy
9998
createIdentityTokenPolicy(policy);
@@ -131,7 +130,7 @@ public static void checkSuccess(int exitCode) {
131130
}
132131

133132
public String createIdentityKey() {
134-
String keyName = randomAlphanumeric(10);
133+
String keyName = secure().nextAlphabetic(10);
135134

136135
int status;
137136
try {
@@ -162,7 +161,7 @@ public String createIdentityKey() {
162161
}
163162

164163
public String createIdentityRole(String keyName) {
165-
String roleName = randomAlphanumeric(10);
164+
String roleName = secure().nextAlphabetic(10);
166165

167166
int status;
168167
try {

tests/src/test/java/io/scalecube/security/vault/VaultServiceTokenTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
import static io.scalecube.security.environment.VaultEnvironment.getRootCause;
44
import static java.util.concurrent.CompletableFuture.completedFuture;
5+
import static org.apache.commons.lang3.RandomStringUtils.secure;
56
import static org.hamcrest.MatcherAssert.assertThat;
67
import static org.hamcrest.core.StringStartsWith.startsWith;
78
import static org.junit.jupiter.api.Assertions.assertNotNull;
89
import static org.junit.jupiter.api.Assertions.assertTrue;
910
import static org.junit.jupiter.api.Assertions.fail;
10-
import static org.testcontainers.shaded.org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
1111

1212
import io.scalecube.security.environment.IntegrationEnvironmentFixture;
1313
import io.scalecube.security.environment.VaultEnvironment;
@@ -32,8 +32,8 @@ void testGetServiceTokenUsingWrongCredentials(VaultEnvironment vaultEnvironment)
3232
final var serviceTokenSupplier =
3333
VaultServiceTokenSupplier.builder()
3434
.vaultAddress(vaultEnvironment.vaultAddr())
35-
.vaultTokenSupplier(() -> completedFuture(randomAlphabetic(16)))
36-
.serviceRole(randomAlphabetic(16))
35+
.vaultTokenSupplier(() -> completedFuture(secure().nextAlphabetic(16)))
36+
.serviceRole(secure().nextAlphabetic(16))
3737
.serviceTokenNameBuilder((role, attributes) -> role)
3838
.build();
3939

@@ -141,7 +141,8 @@ void testGetServiceTokenSuccessfully(VaultEnvironment vaultEnvironment) throws E
141141
// Verify serviceToken
142142

143143
final var jwtToken =
144-
new Auth0JwtTokenResolver(JwksKeyProvider.builder().jwksUri(vaultEnvironment.jwksUri()).build())
144+
new Auth0JwtTokenResolver(
145+
JwksKeyProvider.builder().jwksUri(vaultEnvironment.jwksUri()).build())
145146
.resolveToken(serviceToken)
146147
.get(3, TimeUnit.SECONDS);
147148

0 commit comments

Comments
 (0)