Skip to content

Commit

Permalink
Adjsut imports
Browse files Browse the repository at this point in the history
  • Loading branch information
vasireddy99 committed Oct 5, 2023
1 parent cdabe72 commit 67513b4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
4 changes: 2 additions & 2 deletions adot-testbed/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction

The tests require that AWS credentias are sent to the container under test. Please follow this procedure.
The tests require that AWS credentials are sent to the container under test. Please follow this procedure.


```
Expand All @@ -9,4 +9,4 @@ export AWS_ACCESS_KEY_ID=<key>
export AWS_SECRET_ACCESS_KEY=<secret>
export AWS_SESSION_TOKEN=<session>
./gradlew test --rerun-tasks --info
```
```
Original file line number Diff line number Diff line change
@@ -1,48 +1,43 @@
package software.amazon.adot.testbed;
import java.io.FileWriter;
/*
* This Java source file was generated by the Gradle 'init' task.
*/

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import com.github.rholder.retry.RetryerBuilder;
import com.github.rholder.retry.StopStrategies;
import com.github.rholder.retry.WaitStrategies;
import net.bytebuddy.asm.Advice;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
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;
import org.testcontainers.utility.MountableFile;
import software.amazon.awssdk.services.cloudwatchlogs.CloudWatchLogsClient;
import software.amazon.awssdk.services.cloudwatchlogs.model.GetLogEventsRequest;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.InputStream;

import java.io.FileWriter;
import java.io.IOException;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.HashMap;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import static org.assertj.core.api.Assertions.assertThat;

import static org.junit.jupiter.api.Assertions.*;

@Testcontainers(disabledWithoutDocker = true)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class LogsTests {
Expand All @@ -60,9 +55,10 @@ class LogsTests {

private GenericContainer<?> createAndStartCollector(String configFilePath, String logFilePath, String uniqueLogStreamName) throws IOException {

// Create an environment variable map
// Create an environment variable map
Map<String, String> envVariables = new HashMap<>();
envVariables.put("LOG_STREAM_NAME", uniqueLogStreamName);

var collector = new GenericContainer<>(TEST_IMAGE)
.withExposedPorts(4317)
.withCopyFileToContainer(MountableFile.forClasspathResource(configFilePath), "/etc/collector/config.yaml")
Expand Down

0 comments on commit 67513b4

Please sign in to comment.