Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions libs/java/server_aws_common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<!-- Disable EC2 IMDS to prevent real AWS calls during tests -->
<aws.disableEc2Metadata>true</aws.disableEc2Metadata>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,17 @@ public void testAwsSyncerInitBadRegion() {

try {
new AwsDomainStore();
fail("Expected exception was not thrown");
} catch (Exception exc) {
System.out.println("testCloudInitBadRegion: AwsSyncer throws=" + exc);
assertTrue(exc instanceof SdkClientException);
System.out.println("testAwsSyncerInitBadRegion: AwsSyncer throws=" + exc);
assertTrue(exc instanceof SdkClientException || exc instanceof AwsServiceException,
"Expected SdkClientException or AwsServiceException, got: " + exc.getClass().getName());
Comment thread
Bhuff1 marked this conversation as resolved.
} finally {
System.clearProperty(Config.PROP_PREFIX + Config.SYNC_CFG_PARAM_ROOT_PATH);
System.clearProperty(Config.PROP_PREFIX + Config.SYNC_CFG_PARAM_AWS_ACCESS_KEY);
System.clearProperty(Config.PROP_PREFIX + Config.SYNC_CFG_PARAM_AWS_KEY_ID);
System.clearProperty(Config.PROP_PREFIX + Config.SYNC_CFG_PARAM_AWS_S3_REGION);
}

System.clearProperty(Config.PROP_PREFIX + Config.SYNC_CFG_PARAM_ROOT_PATH);
System.clearProperty(Config.PROP_PREFIX + Config.SYNC_CFG_PARAM_AWS_ACCESS_KEY);
System.clearProperty(Config.PROP_PREFIX + Config.SYNC_CFG_PARAM_AWS_KEY_ID);
System.clearProperty(Config.PROP_PREFIX + Config.SYNC_CFG_PARAM_AWS_S3_REGION);
}

@Test
Expand Down
Loading