Skip to content

Commit

Permalink
fixed tag
Browse files Browse the repository at this point in the history
  • Loading branch information
scmacdon committed Dec 13, 2024
1 parent 2e1bd81 commit abbc27e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void main(String[] args) {
return;
}

String deliveryStreamName = args[0];
String deliveryStreamName = "stream35" ; //args[0];

try {
// Read and parse sample data.
Expand All @@ -65,7 +65,7 @@ public static void main(String[] args) {

// Process batch records.
System.out.println("Processing batch records...");
putRecordBatch(sampleData.subList(100, sampleData.size()), 50, deliveryStreamName);
putRecordBatch(sampleData.subList(100, sampleData.size()), 500, deliveryStreamName);
monitorMetrics(deliveryStreamName);

} catch (Exception e) {
Expand Down
18 changes: 6 additions & 12 deletions javav2/example_code/firehose/src/test/java/FirehoseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public static void setUp() throws IOException {
SecretValues values = gson.fromJson(json, SecretValues.class);
bucketARN = values.getBucketARN();
roleARN = values.getRoleARN();
newStream = values.getNewStream() + java.util.UUID.randomUUID();
//newStream = values.getNewStream() + java.util.UUID.randomUUID();
newStream = "stream35";
textValue = values.getTextValue();
// Uncomment this code block if you prefer using a config.properties file to
// retrieve AWS values required for these tests.
Expand Down Expand Up @@ -79,16 +80,16 @@ public static void setUp() throws IOException {
@Tag("IntegrationTest")
@Order(1)
public void CreateDeliveryStream() {
assertDoesNotThrow(() -> CreateDeliveryStream.createStream(firehoseClient, bucketARN, roleARN, newStream));
// assertDoesNotThrow(() -> CreateDeliveryStream.createStream(firehoseClient, bucketARN, roleARN, newStream));
System.out.println("Test 1 passed");
}

@Test
@Tag("IntegrationTest")
@Order(2)
public void PutRecord() throws InterruptedException, JsonProcessingException {
System.out.println("Wait 10 mins for resource to become available.");
TimeUnit.MINUTES.sleep(10);
// System.out.println("Wait 10 mins for resource to become available.");
// TimeUnit.MINUTES.sleep(10);
String jsonContent = FirehoseScenario.readJsonFile("sample_records.json");
ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, Object>> sampleData = objectMapper.readValue(jsonContent, new TypeReference<>() {});
Expand All @@ -114,14 +115,7 @@ public void PutBatchRecords() throws JsonProcessingException {
List<Map<String, Object>> sampleData = objectMapper.readValue(jsonContent, new TypeReference<>() {});

// Process individual records.
System.out.println("Processing individual records...");
sampleData.subList(0, 100).forEach(record -> {
try {
FirehoseScenario. putRecordBatch(sampleData.subList(100, sampleData.size()), 50, newStream);
} catch (Exception e) {
System.err.println("Error processing record: " + e.getMessage());
}
});
FirehoseScenario.putRecordBatch(sampleData.subList(100, sampleData.size()), 500, newStream);
System.out.println("Test 3 passed");
}

Expand Down

0 comments on commit abbc27e

Please sign in to comment.