Skip to content

Commit

Permalink
cleanup, also directly set all properties on current VM
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Nov 16, 2023
1 parent 99542fb commit 61c2623
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/test/java/io/cryostat/resources/LocalStackResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import io.quarkus.test.common.DevServicesContext;
import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
import org.jboss.logging.Logger;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.utility.DockerImageName;
Expand All @@ -37,6 +38,7 @@ public class LocalStackResource
"EAGER_SERVICE_LOADING", "1",
"SKIP_SSL_CERT_DOWNLOAD", "1",
"DISABLE_EVENTS", "1");
private static final Logger logger = Logger.getLogger(LocalStackResource.class);
private Optional<String> containerNetworkId;
private GenericContainer<?> container;

Expand All @@ -59,12 +61,13 @@ public Map<String, String> start() {
properties.put("s3.url.override", networkHostPort);
properties.put("quarkus.s3.endpoint-override", properties.get("s3.url.override"));
properties.put("quarkus.s3.path-style-access", "true");
properties.put("quarkus.s3.aws.region", "us-east-1");
properties.put("quarkus.s3.aws.credentials.type", "static");
properties.put("quarkus.s3.aws.credentials.static-provider.access-key-id", "unused");
properties.put("quarkus.s3.aws.credentials.static-provider.secret-access-key", "unused");
properties.put("aws.access-key-id", "unused");
properties.put("aws.secret-access-key", "unused");
properties.put("aws.access-key-id", properties.get("quarkus.s3.aws.credentials.static-provider.access-key-id"));
properties.put("aws.secret-access-key", properties.get("quarkus.s3.aws.credentials.static-provider.secret-access-key"));
properties.entrySet().forEach(e -> System.setProperty(e.getKey(), e.getValue()));
logger.infov("Configured properties: {0}", properties);

return properties;
}
Expand Down

0 comments on commit 61c2623

Please sign in to comment.