Skip to content

Commit 37fd0db

Browse files
committed
Fix tests on CodeBuild
1 parent 00e4962 commit 37fd0db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/aws-core/src/test/java/software/amazon/awssdk/awscore/internal/AutoDefaultsModeDiscoveryTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,20 @@ public void differentCombinationOfConfigs_shouldResolveCorrectly() throws Except
108108
if (testData.awsExecutionEnvVar != null) {
109109
ENVIRONMENT_VARIABLE_HELPER.set(SdkSystemSetting.AWS_EXECUTION_ENV.environmentVariable(),
110110
testData.awsExecutionEnvVar);
111+
} else {
112+
ENVIRONMENT_VARIABLE_HELPER.remove(SdkSystemSetting.AWS_EXECUTION_ENV.environmentVariable());
111113
}
112114

113115
if (testData.awsRegionEnvVar != null) {
114116
ENVIRONMENT_VARIABLE_HELPER.set(SdkSystemSetting.AWS_REGION.environmentVariable(), testData.awsRegionEnvVar);
117+
} else {
118+
ENVIRONMENT_VARIABLE_HELPER.remove(SdkSystemSetting.AWS_REGION.environmentVariable());
115119
}
116120

117121
if (testData.awsDefaultRegionEnvVar != null) {
118122
ENVIRONMENT_VARIABLE_HELPER.set("AWS_DEFAULT_REGION", testData.awsDefaultRegionEnvVar);
123+
} else {
124+
ENVIRONMENT_VARIABLE_HELPER.remove("AWS_DEFAULT_REGION");
119125
}
120126

121127
if (testData.ec2MetadataConfig != null) {

0 commit comments

Comments
 (0)