Skip to content

Commit

Permalink
updated POM
Browse files Browse the repository at this point in the history
  • Loading branch information
scmacdon committed Feb 14, 2024
1 parent de8d84f commit 504d0e4
Show file tree
Hide file tree
Showing 29 changed files with 103,530 additions and 258 deletions.
2 changes: 1 addition & 1 deletion javav2/example_code/ec2/src/test/java/EC2Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static void setUp() throws IOException {
ami = values.getAmi();
instanceName = values.getInstanceName();
keyName = values.getKeyNameSc();
groupName = values.getGroupName() + java.util.UUID.randomUUID();;
groupName = values.getGroupName() + java.util.UUID.randomUUID();
groupDesc = values.getGroupDesc();
vpcId = values.getVpcId();
keyNameSc = values.getKeyNameSc() + java.util.UUID.randomUUID();
Expand Down
2 changes: 1 addition & 1 deletion javav2/example_code/elasticbeanstalk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.21.20</version>
<version>2.23.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion javav2/example_code/emr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.21.20</version>
<version>2.23.0</version>
<type>pom</type>
</dependency>
</dependencies>
Expand Down
12 changes: 2 additions & 10 deletions javav2/example_code/emr/src/test/java/EMRTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class EMRTest {
private static String logUri = "";
private static String name = "";
private static String jobFlowId = "";
private static String existingClusterId = "";

@BeforeAll
public static void setUp() throws IOException {
Expand All @@ -45,7 +44,6 @@ public static void setUp() throws IOException {
keys = values.getKeys();
logUri = values.getLogUri();
name = values.getName();
existingClusterId = values.getExistingClusterId();

// Uncomment this code block if you prefer using a config.properties file to
// retrieve AWS values required for these tests.
Expand Down Expand Up @@ -84,7 +82,7 @@ public void createClusterTest() {
@Test
@Order(2)
public void describeClusterTest() {
assertDoesNotThrow(() -> DescribeCluster.describeMyCluster(emrClient, existingClusterId));
assertDoesNotThrow(() -> DescribeCluster.describeMyCluster(emrClient, jobFlowId));
System.out.println("Test 2 passed");
}

Expand Down Expand Up @@ -134,7 +132,7 @@ public void customEmrfsMaterialsTest() {
@Test
@Order(9)
public void terminateJobFlowTest() {
assertDoesNotThrow(() -> TerminateJobFlow.terminateFlow(emrClient, existingClusterId));
assertDoesNotThrow(() -> TerminateJobFlow.terminateFlow(emrClient, jobFlowId));
System.out.println("Test 9 passed");
}

Expand All @@ -156,7 +154,6 @@ private static String getSecretValues() {
@Nested
@DisplayName("A class used to get test values from test/emr (an AWS Secrets Manager secret)")
class SecretValues {
private String existingClusterId;
private String jar;
private String myClass;

Expand All @@ -169,7 +166,6 @@ class SecretValues {
public String getLogUri() {
return logUri;
}

public String getJar() {
return jar;
}
Expand All @@ -185,9 +181,5 @@ public String getKeys() {
public String getName() {
return name;
}

public String getExistingClusterId() {
return existingClusterId;
}
}
}
2 changes: 1 addition & 1 deletion javav2/example_code/eventbridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.21.20</version>
<version>2.23.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion javav2/example_code/firehose/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.21.20</version>
<version>2.23.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion javav2/example_code/forecast/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.21.21</version>
<version>2.23.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion javav2/example_code/glacier/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.21.20</version>
<version>2.23.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion javav2/example_code/glue/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.21.20</version>
<version>2.23.0</version>
<type>pom</type>
</dependency>
</dependencies>
Expand Down
57 changes: 0 additions & 57 deletions javav2/example_code/glue/src/test/java/GlueTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,8 @@
public class GlueTest {

private static GlueClient glueClient;
private static String crawlerName = "";
private static String cron = "";
private static String s3Path = "";
private static String IAM = "";
private static String databaseName = "";
private static String tableName = "";
private static String text = "";
private static String existingDatabaseName = "";
private static String existingCrawlerName = "";
private static String jobNameSc = "";
private static String s3PathSc = "";
private static String dbNameSc = "";
Expand All @@ -51,19 +44,10 @@ public static void setUp() throws IOException, URISyntaxException {
Gson gson = new Gson();
String json = getSecretValues();
SecretValues values = gson.fromJson(json, SecretValues.class);
crawlerName = values.getCrawlerName();
s3Path = values.getS3Path();
cron = values.getCron();
IAM = values.getIAM();
databaseName = values.getDatabaseName();
tableName = values.getTableName();
text = values.getText();
existingDatabaseName = values.getExistingDatabaseName();
existingCrawlerName = values.getExistingCrawlerName();
jobNameSc = values.getJobNameSc() + java.util.UUID.randomUUID();
;
s3PathSc = values.getS3PathSc() + java.util.UUID.randomUUID();
;
dbNameSc = values.getDbNameSc() + java.util.UUID.randomUUID();
crawlerNameSc = values.getCrawlerNameSc() + java.util.UUID.randomUUID();
scriptLocationSc = values.getScriptLocationSc();
Expand Down Expand Up @@ -149,17 +133,6 @@ private static String getSecretValues() {
@Nested
@DisplayName("A class used to get test values from test/glue (an AWS Secrets Manager secret)")
class SecretValues {
private String IAM;
private String s3Path;
private String cron;

private String crawlerName;

private String existingCrawlerName;

private String databaseName;

private String existingDatabaseName;

private String tableName;

Expand All @@ -180,39 +153,10 @@ class SecretValues {
public String getIAM() {
return IAM;
}

public String getS3Path() {
return s3Path;
}

public String getCron() {
return cron;
}

public String getCrawlerName() {
return crawlerName;
}

public String getExistingCrawlerName() {
return existingCrawlerName;
}

public String getDatabaseName() {
return databaseName;
}

public String getExistingDatabaseName() {
return existingDatabaseName;
}

public String getTableName() {
return tableName;
}

public String getText() {
return text;
}

public String getJobNameSc() {
return jobNameSc;
}
Expand Down Expand Up @@ -241,5 +185,4 @@ public String getBucketNameSc() {
return bucketNameSc;
}
}

}
2 changes: 1 addition & 1 deletion javav2/example_code/guardduty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.21.20</version>
<version>2.23.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
6 changes: 2 additions & 4 deletions javav2/example_code/iam/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.21.20</version>
<version>2.23.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -121,14 +121,12 @@
<artifactId>accessanalyzer</artifactId>
</dependency>


<!-- Needed to adapt Apache Commons Logging used by Apache HTTP Client to Slf4j to avoid
ClassNotFoundException: org.apache.commons.logging.impl.LogFactoryImpl during runtime -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
<version>1.7.32</version>
</dependency>

</dependencies>
</project>
10 changes: 6 additions & 4 deletions javav2/example_code/iam/src/test/java/IAMServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import software.amazon.awssdk.services.secretsmanager.SecretsManagerClient;
import software.amazon.awssdk.services.secretsmanager.model.GetSecretValueRequest;
import software.amazon.awssdk.services.secretsmanager.model.GetSecretValueResponse;

import java.util.UUID;
import java.util.concurrent.TimeUnit;

/**
Expand Down Expand Up @@ -54,10 +56,10 @@ public static void setUp() {
policyName = values.getPolicyName();
roleName = values.getRoleName();
accountAlias = values.getAccountAlias();
usernameSc = values.getUsernameSc();
policyNameSc = values.getPolicyNameSc();
roleNameSc = values.getRoleNameSc();
roleSessionName = values.getRoleName();
usernameSc = values.getUsernameSc() + UUID.randomUUID();
policyNameSc = values.getPolicyNameSc() + UUID.randomUUID();
roleNameSc = values.getRoleNameSc() + UUID.randomUUID();
roleSessionName = values.getRoleName() ;
fileLocationSc = values.getFileLocationSc();
bucketNameSc = values.getBucketNameSc();

Expand Down
2 changes: 1 addition & 1 deletion javav2/example_code/kendra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.21.20</version>
<version>2.23.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion javav2/example_code/keyspaces/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.21.20</version>
<version>2.23.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public class ScenarioKeyspaces {
*/
public static void main(String[] args) throws InterruptedException, IOException {
String fileName = "<Replace with the JSON file that contains movie data>";
String configFilePath = "C:\\AWS\\application.conf";
String keyspaceName = "<Replace with the name of the keyspace to create>";
String titleUpdate = "The Family";
int yearUpdate = 2013;
Expand All @@ -114,7 +115,7 @@ public static void main(String[] args) throws InterruptedException, IOException
.region(region)
.build();

DriverConfigLoader loader = DriverConfigLoader.fromClasspath("application.conf");
DriverConfigLoader loader = DriverConfigLoader.fromFile(new File(configFilePath));
CqlSession session = CqlSession.builder()
.withConfigLoader(loader)
.build();
Expand Down
Loading

0 comments on commit 504d0e4

Please sign in to comment.