diff --git a/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/defaultsmode/DefaultsModeGenerationTest.java b/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/defaultsmode/DefaultsModeGenerationTest.java
index 9ceb3c9e40d4..4a804d0d9c45 100644
--- a/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/defaultsmode/DefaultsModeGenerationTest.java
+++ b/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/defaultsmode/DefaultsModeGenerationTest.java
@@ -19,8 +19,8 @@
import java.io.File;
import java.nio.file.Paths;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
public class DefaultsModeGenerationTest {
@@ -30,7 +30,7 @@ public class DefaultsModeGenerationTest {
private File file;
private DefaultConfiguration defaultConfiguration;
- @Before
+ @BeforeEach
public void before() throws Exception {
this.file = Paths.get(getClass().getResource(DEFAULT_CONFIGURATION).toURI()).toFile();
this.defaultConfiguration = DefaultsLoader.load(file);
diff --git a/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/regions/RegionGenerationTest.java b/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/regions/RegionGenerationTest.java
index 4bd602b4e78e..0240958a17d9 100644
--- a/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/regions/RegionGenerationTest.java
+++ b/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/regions/RegionGenerationTest.java
@@ -19,8 +19,8 @@
import java.io.File;
import java.nio.file.Paths;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.lite.regions.model.Partition;
import software.amazon.awssdk.codegen.lite.regions.model.Partitions;
@@ -35,7 +35,7 @@ public class RegionGenerationTest {
private File endpoints;
private Partitions partitions;
- @Before
+ @BeforeEach
public void before() throws Exception {
this.endpoints = Paths.get(getClass().getResource(ENDPOINTS).toURI()).toFile();
this.partitions = RegionMetadataLoader.build(endpoints);
diff --git a/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/regions/RegionValidationUtilTest.java b/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/regions/RegionValidationUtilTest.java
index 80c47e3c2f90..7e71b0c2442e 100644
--- a/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/regions/RegionValidationUtilTest.java
+++ b/codegen-lite/src/test/java/software/amazon/awssdk/codegen/lite/regions/RegionValidationUtilTest.java
@@ -14,10 +14,10 @@
*/
package software.amazon.awssdk.codegen.lite.regions;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class RegionValidationUtilTest {
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/IntermediateModelBuilderTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/IntermediateModelBuilderTest.java
index 378f45a6f4b4..413c11d63749 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/IntermediateModelBuilderTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/IntermediateModelBuilderTest.java
@@ -16,12 +16,12 @@
package software.amazon.awssdk.codegen;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.File;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig;
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
import software.amazon.awssdk.codegen.model.intermediate.ShapeModel;
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/customization/processors/UseLegacyEventGenerationSchemeProcessorTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/customization/processors/UseLegacyEventGenerationSchemeProcessorTest.java
index ff041882bbc7..8ce643852ef8 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/customization/processors/UseLegacyEventGenerationSchemeProcessorTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/customization/processors/UseLegacyEventGenerationSchemeProcessorTest.java
@@ -17,9 +17,9 @@
import java.io.File;
-import org.junit.BeforeClass;
import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.junit.rules.ExpectedException;
import software.amazon.awssdk.codegen.C2jModels;
import software.amazon.awssdk.codegen.IntermediateModelBuilder;
@@ -42,7 +42,7 @@ public class UseLegacyEventGenerationSchemeProcessorTest {
private static ServiceModel serviceModel;
- @BeforeClass
+ @BeforeAll
public static void setup() {
String c2jFilePath = UseLegacyEventGenerationSchemeProcessorTest.class.getResource(RESOURCE_ROOT + "/service-2.json").getFile();
File c2jFile = new File(c2jFilePath);
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/emitters/CodeTransformerTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/emitters/CodeTransformerTest.java
index 48d97e5804b8..64cf563712d0 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/emitters/CodeTransformerTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/emitters/CodeTransformerTest.java
@@ -20,7 +20,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class CodeTransformerTest {
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/emitters/UnusedImportRemoverTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/emitters/UnusedImportRemoverTest.java
index 20766c8cd6c6..81e637e47e7a 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/emitters/UnusedImportRemoverTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/emitters/UnusedImportRemoverTest.java
@@ -21,7 +21,7 @@
import java.nio.file.Files;
import java.nio.file.Paths;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class UnusedImportRemoverTest {
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/internal/DocumentationUtilsTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/internal/DocumentationUtilsTest.java
index a07e367409cc..4054a8e55ecf 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/internal/DocumentationUtilsTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/internal/DocumentationUtilsTest.java
@@ -14,9 +14,11 @@
*/
package software.amazon.awssdk.codegen.internal;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
import org.hamcrest.Matchers;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class DocumentationUtilsTest {
@@ -24,24 +26,24 @@ public class DocumentationUtilsTest {
@Test
public void strip_html_tags_null_or_empty_input_returns_empty_string() {
- Assert.assertThat(DocumentationUtils.stripHtmlTags(null), Matchers
+ assertThat(DocumentationUtils.stripHtmlTags(null), Matchers
.isEmptyString());
- Assert.assertThat(DocumentationUtils.stripHtmlTags(""), Matchers
+ assertThat(DocumentationUtils.stripHtmlTags(""), Matchers
.isEmptyString());
}
@Test
public void html_tags_at_start_of_string_are_removed() {
- Assert.assertEquals("foo", DocumentationUtils.stripHtmlTags
+ assertEquals("foo", DocumentationUtils.stripHtmlTags
("foo"));
}
@Test
public void empty_html_tags_at_start_are_removed() {
- Assert.assertThat(DocumentationUtils.stripHtmlTags("
"), Matchers
+ assertThat(DocumentationUtils.stripHtmlTags(""), Matchers
.isEmptyString());
- Assert.assertThat(DocumentationUtils.stripHtmlTags(""), Matchers
+ assertThat(DocumentationUtils.stripHtmlTags(""), Matchers
.isEmptyString());
}
}
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/internal/UtilsTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/internal/UtilsTest.java
index cacce1621c53..6df868851e1f 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/internal/UtilsTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/internal/UtilsTest.java
@@ -21,7 +21,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class UtilsTest {
final Map capitalizedToUncapitalized = new HashMap() {{
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/jmespath/JmesPathParserTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/jmespath/JmesPathParserTest.java
index a1b9b0ad8f51..7687a36fbcc4 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/jmespath/JmesPathParserTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/jmespath/JmesPathParserTest.java
@@ -17,7 +17,7 @@
import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.jmespath.component.Comparator;
import software.amazon.awssdk.codegen.jmespath.component.Expression;
import software.amazon.awssdk.codegen.jmespath.parser.JmesPathParser;
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/model/intermediate/DocumentationBuilderTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/model/intermediate/DocumentationBuilderTest.java
index b83ad1f93a44..ad83e3bb5264 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/model/intermediate/DocumentationBuilderTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/model/intermediate/DocumentationBuilderTest.java
@@ -19,7 +19,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static software.amazon.awssdk.codegen.TestStringUtils.toPlatformLfs;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.docs.DocumentationBuilder;
public class DocumentationBuilderTest {
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/model/intermediate/IntermediateModelTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/model/intermediate/IntermediateModelTest.java
index 418e9b49b40a..d87cf898932f 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/model/intermediate/IntermediateModelTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/model/intermediate/IntermediateModelTest.java
@@ -19,7 +19,7 @@
import java.io.File;
import java.util.Collections;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.C2jModels;
import software.amazon.awssdk.codegen.IntermediateModelBuilder;
import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig;
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/model/service/PaginatorDefinitionTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/model/service/PaginatorDefinitionTest.java
index a1c09b74f7fd..e0b6af9ce4fa 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/model/service/PaginatorDefinitionTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/model/service/PaginatorDefinitionTest.java
@@ -15,13 +15,13 @@
package software.amazon.awssdk.codegen.model.service;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Arrays;
import java.util.Collections;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class PaginatorDefinitionTest {
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/PoetCollectorsTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/PoetCollectorsTest.java
index 99a2b9331ad2..d475207532d5 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/PoetCollectorsTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/PoetCollectorsTest.java
@@ -19,7 +19,7 @@
import com.squareup.javapoet.CodeBlock;
import java.util.stream.Stream;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* Validate functionality of the {@link PoetCollectors}.
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/builder/BuilderClassTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/builder/BuilderClassTest.java
index 385b97df4679..88b8c068dd62 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/builder/BuilderClassTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/builder/BuilderClassTest.java
@@ -19,7 +19,7 @@
import static software.amazon.awssdk.codegen.poet.PoetMatchers.generatesTo;
import java.util.function.Function;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
import software.amazon.awssdk.codegen.poet.ClassSpec;
import software.amazon.awssdk.codegen.poet.ClientTestModels;
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/common/EnumClassTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/common/EnumClassTest.java
index 80c8fcf87907..e2de6a1252ae 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/common/EnumClassTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/common/EnumClassTest.java
@@ -20,7 +20,7 @@
import static software.amazon.awssdk.codegen.poet.PoetMatchers.generatesTo;
import java.io.IOException;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.model.intermediate.EnumModel;
import software.amazon.awssdk.codegen.model.intermediate.ShapeModel;
import software.amazon.awssdk.codegen.model.intermediate.ShapeType;
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/endpointdiscovery/EndpointDiscoveryCacheLoaderGeneratorTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/endpointdiscovery/EndpointDiscoveryCacheLoaderGeneratorTest.java
index 6bd879fc697a..e0b6cd4ab35d 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/endpointdiscovery/EndpointDiscoveryCacheLoaderGeneratorTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/endpointdiscovery/EndpointDiscoveryCacheLoaderGeneratorTest.java
@@ -17,7 +17,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static software.amazon.awssdk.codegen.poet.PoetMatchers.generatesTo;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.emitters.GeneratorTaskParams;
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
import software.amazon.awssdk.codegen.poet.ClientTestModels;
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/eventstream/EventStreamFunctionalTests.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/eventstream/EventStreamFunctionalTests.java
index c60d8c5ee2be..c2bf962b5ab1 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/eventstream/EventStreamFunctionalTests.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/eventstream/EventStreamFunctionalTests.java
@@ -19,7 +19,7 @@
import static software.amazon.awssdk.codegen.poet.PoetMatchers.generatesTo;
import java.util.function.BiFunction;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.emitters.GeneratorTaskParams;
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
import software.amazon.awssdk.codegen.model.intermediate.OperationModel;
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/AwsServiceBaseRequestSpecTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/AwsServiceBaseRequestSpecTest.java
index 0f6a6a9b16ad..b5b07319b027 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/AwsServiceBaseRequestSpecTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/AwsServiceBaseRequestSpecTest.java
@@ -20,8 +20,8 @@
import java.io.File;
import java.io.IOException;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.C2jModels;
import software.amazon.awssdk.codegen.IntermediateModelBuilder;
import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig;
@@ -32,7 +32,7 @@
public class AwsServiceBaseRequestSpecTest {
private static IntermediateModel intermediateModel;
- @BeforeClass
+ @BeforeAll
public static void setUp() throws IOException {
File serviceModelFile = new File(AwsModelSpecTest.class.getResource("service-2.json").getFile());
File customizationConfigFile = new File(AwsModelSpecTest.class
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/AwsServiceBaseResponseSpecTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/AwsServiceBaseResponseSpecTest.java
index 3b58688d4f4f..4700fc8bc854 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/AwsServiceBaseResponseSpecTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/AwsServiceBaseResponseSpecTest.java
@@ -20,8 +20,8 @@
import java.io.File;
import java.io.IOException;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.C2jModels;
import software.amazon.awssdk.codegen.IntermediateModelBuilder;
import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig;
@@ -32,7 +32,7 @@
public class AwsServiceBaseResponseSpecTest {
private static IntermediateModel intermediateModel;
- @BeforeClass
+ @BeforeAll
public static void setUp() throws IOException {
File serviceModelFile = new File(AwsModelSpecTest.class.getResource("service-2.json").getFile());
File customizationConfigFile = new File(AwsModelSpecTest.class
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/BaseExceptionClassSpecTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/BaseExceptionClassSpecTest.java
index 964def2d18b5..d53d7e0a30f4 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/BaseExceptionClassSpecTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/BaseExceptionClassSpecTest.java
@@ -19,8 +19,8 @@
import java.io.File;
import java.io.IOException;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.C2jModels;
import software.amazon.awssdk.codegen.IntermediateModelBuilder;
import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig;
@@ -31,7 +31,7 @@
public class BaseExceptionClassSpecTest {
private static IntermediateModel intermediateModel;
- @BeforeClass
+ @BeforeAll
public static void setUp() throws IOException {
File serviceModelFile = new File(AwsModelSpecTest.class.getResource("service-2.json").getFile());
File customizationConfigFile = new File(AwsModelSpecTest.class
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/ResponseMetadataSpecTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/ResponseMetadataSpecTest.java
index f4a42ee702a3..e1e8d131d6bf 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/ResponseMetadataSpecTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/model/ResponseMetadataSpecTest.java
@@ -20,8 +20,8 @@
import java.io.File;
import java.io.IOException;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.C2jModels;
import software.amazon.awssdk.codegen.IntermediateModelBuilder;
import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig;
@@ -33,7 +33,7 @@ public class ResponseMetadataSpecTest {
private static IntermediateModel model;
private static IntermediateModel modelWithCustomizedResponseMetadata;
- @BeforeClass
+ @BeforeAll
public static void setUp() throws IOException {
File serviceModelFile = new File(AwsModelSpecTest.class.getResource("service-2.json")
.getFile());
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/paginators/PaginatedResponseClassSpecTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/paginators/PaginatedResponseClassSpecTest.java
index a55b77c3a53c..6527a4f8306d 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/paginators/PaginatedResponseClassSpecTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/paginators/PaginatedResponseClassSpecTest.java
@@ -21,8 +21,8 @@
import java.io.File;
import java.io.IOException;
import java.util.Map;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.C2jModels;
import software.amazon.awssdk.codegen.IntermediateModelBuilder;
import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig;
@@ -42,7 +42,7 @@ public class PaginatedResponseClassSpecTest {
private static Paginators paginators;
private static Map paginationCustomization;
- @BeforeClass
+ @BeforeAll
public static void setUp() throws IOException {
File serviceModelFile = new File(PaginatedResponseClassSpecTest.class.getResource("service-2.json").getFile());
File customizationConfigFile = new File(PaginatedResponseClassSpecTest.class.getResource("customization.config")
diff --git a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/waiters/WaitersClassSpecTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/waiters/WaitersClassSpecTest.java
index 1713518aaf40..bad46646a763 100644
--- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/waiters/WaitersClassSpecTest.java
+++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/waiters/WaitersClassSpecTest.java
@@ -18,25 +18,9 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static software.amazon.awssdk.codegen.poet.PoetMatchers.generatesTo;
-import java.io.File;
-import java.io.IOException;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import software.amazon.awssdk.codegen.C2jModels;
-import software.amazon.awssdk.codegen.IntermediateModelBuilder;
-import software.amazon.awssdk.codegen.emitters.GeneratorTaskParams;
-import software.amazon.awssdk.codegen.model.config.customization.CustomizationConfig;
-import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
-import software.amazon.awssdk.codegen.model.service.ServiceModel;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.codegen.poet.ClassSpec;
import software.amazon.awssdk.codegen.poet.ClientTestModels;
-import software.amazon.awssdk.codegen.poet.client.AsyncClientClass;
-import software.amazon.awssdk.codegen.poet.client.AsyncClientInterface;
-import software.amazon.awssdk.codegen.poet.client.ClientSimpleMethodsIntegrationTests;
-import software.amazon.awssdk.codegen.poet.client.SyncClientClass;
-import software.amazon.awssdk.codegen.poet.client.SyncClientInterface;
-import software.amazon.awssdk.codegen.poet.paginators.PaginatedResponseClassSpecTest;
-import software.amazon.awssdk.codegen.utils.ModelLoaderUtils;
public class WaitersClassSpecTest {
diff --git a/core/arns/src/test/java/software/amazon/awssdk/arns/ArnResourceTest.java b/core/arns/src/test/java/software/amazon/awssdk/arns/ArnResourceTest.java
index e5fa6c0b6d8d..6ec3e4181362 100644
--- a/core/arns/src/test/java/software/amazon/awssdk/arns/ArnResourceTest.java
+++ b/core/arns/src/test/java/software/amazon/awssdk/arns/ArnResourceTest.java
@@ -20,7 +20,7 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import java.util.Optional;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class ArnResourceTest {
diff --git a/core/arns/src/test/java/software/amazon/awssdk/arns/ArnTest.java b/core/arns/src/test/java/software/amazon/awssdk/arns/ArnTest.java
index 7a4e26e2606d..1ef33c7d0033 100644
--- a/core/arns/src/test/java/software/amazon/awssdk/arns/ArnTest.java
+++ b/core/arns/src/test/java/software/amazon/awssdk/arns/ArnTest.java
@@ -18,8 +18,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import java.util.Optional;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class ArnTest {
diff --git a/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/AwsCrt4aSigningAdapterTest.java b/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/AwsCrt4aSigningAdapterTest.java
index 24ff4829ca56..90029a2648c7 100644
--- a/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/AwsCrt4aSigningAdapterTest.java
+++ b/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/AwsCrt4aSigningAdapterTest.java
@@ -1,7 +1,7 @@
package software.amazon.awssdk.authcrt.signer.internal;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static software.amazon.awssdk.auth.signer.internal.Aws4SignerUtils.calculateRequestContentLength;
import static software.amazon.awssdk.authcrt.signer.SignerTestUtils.extractSignatureFromAuthHeader;
import static software.amazon.awssdk.authcrt.signer.SignerTestUtils.extractSignedHeadersFromAuthHeader;
@@ -9,14 +9,14 @@
import java.util.Arrays;
import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-import software.amazon.awssdk.core.internal.chunked.AwsChunkedEncodingConfig;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.signer.internal.chunkedencoding.AwsSignedChunkedEncodingInputStream;
import software.amazon.awssdk.authcrt.signer.SignerTestUtils;
import software.amazon.awssdk.authcrt.signer.SigningTestCase;
import software.amazon.awssdk.authcrt.signer.internal.chunkedencoding.AwsS3V4aChunkSigner;
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
+import software.amazon.awssdk.core.internal.chunked.AwsChunkedEncodingConfig;
import software.amazon.awssdk.crt.auth.signing.AwsSigningConfig;
import software.amazon.awssdk.http.SdkHttpFullRequest;
@@ -25,7 +25,7 @@ public class AwsCrt4aSigningAdapterTest {
AwsCrt4aSigningAdapter crtSigningAdapter;
SigningConfigProvider configProvider;
- @Before
+ @BeforeEach
public void setup() {
crtSigningAdapter = new AwsCrt4aSigningAdapter();
configProvider = new SigningConfigProvider();
diff --git a/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/CrtHttpRequestConverterTest.java b/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/CrtHttpRequestConverterTest.java
index 34b5fea67b04..14706ad1f267 100644
--- a/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/CrtHttpRequestConverterTest.java
+++ b/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/CrtHttpRequestConverterTest.java
@@ -23,8 +23,8 @@
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.crt.http.HttpHeader;
import software.amazon.awssdk.crt.http.HttpRequest;
import software.amazon.awssdk.crt.http.HttpRequestBodyStream;
@@ -36,7 +36,7 @@ public class CrtHttpRequestConverterTest {
CrtHttpRequestConverter converter;
- @Before
+ @BeforeEach
public void setup() {
converter = new CrtHttpRequestConverter();
}
diff --git a/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/SigningConfigProviderTest.java b/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/SigningConfigProviderTest.java
index ac54bd625b04..49769dcd2b2b 100644
--- a/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/SigningConfigProviderTest.java
+++ b/core/auth-crt/src/test/java/software/amazon/awssdk/authcrt/signer/internal/SigningConfigProviderTest.java
@@ -16,13 +16,13 @@
package software.amazon.awssdk.authcrt.signer.internal;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.signer.AwsSignerExecutionAttribute;
import software.amazon.awssdk.auth.signer.S3SignerExecutionAttribute;
import software.amazon.awssdk.auth.signer.internal.SignerConstant;
@@ -35,7 +35,7 @@ public class SigningConfigProviderTest {
SigningConfigProvider configProvider;
- @Before
+ @BeforeEach
public void setup() {
configProvider = new SigningConfigProvider();
}
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/AwsCredentialsProviderChainTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/AwsCredentialsProviderChainTest.java
index ea8b688e3161..2b848d25fc77 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/AwsCredentialsProviderChainTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/AwsCredentialsProviderChainTest.java
@@ -15,10 +15,10 @@
package software.amazon.awssdk.auth.credentials;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.junit.rules.ExpectedException;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.profiles.ProfileFile;
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/ContainerCredentialsRetryPolicyTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/ContainerCredentialsRetryPolicyTest.java
index 38b4b7c8d4fd..9b9d61e00f46 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/ContainerCredentialsRetryPolicyTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/ContainerCredentialsRetryPolicyTest.java
@@ -15,12 +15,12 @@
package software.amazon.awssdk.auth.credentials;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.credentials.internal.ContainerCredentialsRetryPolicy;
import software.amazon.awssdk.regions.util.ResourcesEndpointRetryParameters;
@@ -28,7 +28,7 @@ public class ContainerCredentialsRetryPolicyTest {
private static ContainerCredentialsRetryPolicy retryPolicy;
- @BeforeClass
+ @BeforeAll
public static void setup() {
retryPolicy = new ContainerCredentialsRetryPolicy();
}
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/CredentialsEndpointRetryParametersTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/CredentialsEndpointRetryParametersTest.java
index aad419e649ba..ad52f6a1d8b0 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/CredentialsEndpointRetryParametersTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/CredentialsEndpointRetryParametersTest.java
@@ -15,12 +15,12 @@
package software.amazon.awssdk.auth.credentials;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.regions.util.ResourcesEndpointRetryParameters;
/**
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/HttpCredentialsProviderTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/HttpCredentialsProviderTest.java
index 2d54507d5ca5..8d73b1a364af 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/HttpCredentialsProviderTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/HttpCredentialsProviderTest.java
@@ -31,9 +31,9 @@
import java.time.Duration;
import java.time.Instant;
import java.util.Date;
-import org.junit.BeforeClass;
import org.junit.ClassRule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.util.SdkUserAgent;
import software.amazon.awssdk.regions.util.ResourcesEndpointProvider;
@@ -51,7 +51,7 @@ public class HttpCredentialsProviderTest {
private static String successResponseWithInvalidBody;
- @BeforeClass
+ @BeforeAll
public static void setup() throws IOException {
try (InputStream successInputStream = HttpCredentialsProviderTest.class.getResourceAsStream
("/resources/wiremock/successResponse.json");
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/InstanceProfileCredentialsProviderTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/InstanceProfileCredentialsProviderTest.java
index 05b4fb6f5885..1858cb1a2f80 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/InstanceProfileCredentialsProviderTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/InstanceProfileCredentialsProviderTest.java
@@ -23,6 +23,7 @@
import static com.github.tomakehurst.wiremock.client.WireMock.putRequestedFor;
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
+
import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
@@ -30,10 +31,10 @@
import com.github.tomakehurst.wiremock.matching.RequestPatternBuilder;
import java.time.Duration;
import java.time.Instant;
-import org.junit.AfterClass;
-import org.junit.Before;
import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.junit.rules.ExpectedException;
import software.amazon.awssdk.core.SdkSystemSetting;
import software.amazon.awssdk.core.exception.SdkClientException;
@@ -56,12 +57,12 @@ public class InstanceProfileCredentialsProviderTest {
@Rule
public WireMockRule mockMetadataEndpoint = new WireMockRule();
- @Before
+ @BeforeEach
public void methodSetup() {
System.setProperty(SdkSystemSetting.AWS_EC2_METADATA_SERVICE_ENDPOINT.property(), "http://localhost:" + mockMetadataEndpoint.port());
}
- @AfterClass
+ @AfterAll
public static void teardown() {
System.clearProperty(SdkSystemSetting.AWS_EC2_METADATA_SERVICE_ENDPOINT.property());
}
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/ProfileCredentialsProviderTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/ProfileCredentialsProviderTest.java
index 8be07bb42bf0..d6f261779206 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/ProfileCredentialsProviderTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/ProfileCredentialsProviderTest.java
@@ -18,7 +18,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.profiles.ProfileFile;
import software.amazon.awssdk.profiles.ProfileProperty;
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/AwsSessionCredentialsTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/AwsSessionCredentialsTest.java
index de34421dee4b..8e9c6a9ee975 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/AwsSessionCredentialsTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/AwsSessionCredentialsTest.java
@@ -18,7 +18,7 @@
import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
public class AwsSessionCredentialsTest {
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/EndpointModeTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/EndpointModeTest.java
index 539666d8227d..b6409ed758d9 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/EndpointModeTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/EndpointModeTest.java
@@ -19,7 +19,8 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static software.amazon.awssdk.auth.credentials.internal.Ec2MetadataConfigProvider.EndpointMode.IPV4;
import static software.amazon.awssdk.auth.credentials.internal.Ec2MetadataConfigProvider.EndpointMode.IPV6;
-import org.junit.Test;
+
+import org.junit.jupiter.api.Test;
public class EndpointModeTest {
@Test
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/LazyAwsCredentialsProviderTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/LazyAwsCredentialsProviderTest.java
index e712ea6257ce..8c0ba8cd62ec 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/LazyAwsCredentialsProviderTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/LazyAwsCredentialsProviderTest.java
@@ -16,8 +16,8 @@
package software.amazon.awssdk.auth.credentials.internal;
import java.util.function.Supplier;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
import software.amazon.awssdk.utils.SdkAutoCloseable;
@@ -28,7 +28,7 @@ public class LazyAwsCredentialsProviderTest {
private AwsCredentialsProvider credentials = Mockito.mock(AwsCredentialsProvider.class);
- @Before
+ @BeforeEach
public void reset() {
Mockito.reset(credentials, credentialsConstructor);
Mockito.when(credentialsConstructor.get()).thenReturn(credentials);
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/ProfileCredentialsUtilsTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/ProfileCredentialsUtilsTest.java
index 1f1a820a3c14..056d964c03d3 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/ProfileCredentialsUtilsTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/credentials/internal/ProfileCredentialsUtilsTest.java
@@ -16,15 +16,15 @@
package software.amazon.awssdk.auth.credentials.internal;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;
-import org.assertj.core.api.Assertions;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.AwsSessionCredentials;
import software.amazon.awssdk.auth.credentials.ProcessCredentialsProviderTest;
@@ -35,12 +35,12 @@
public class ProfileCredentialsUtilsTest {
private static String scriptLocation;
- @BeforeClass
+ @BeforeAll
public static void setup() {
scriptLocation = ProcessCredentialsProviderTest.copyProcessCredentialsScript();
}
- @AfterClass
+ @AfterAll
public static void teardown() {
if (scriptLocation != null && !new File(scriptLocation).delete()) {
throw new IllegalStateException("Failed to delete file: " + scriptLocation);
@@ -66,12 +66,12 @@ public void roleProfileCanInheritFromAnotherFile() {
ProfileFile configProfile = aggregateFileProfiles(configChild, credentialsSource);
Consumer profileValidator = profileFile ->
- Assertions.assertThatThrownBy(new ProfileCredentialsUtils(profileFile, profileFile.profiles().get("child"),
+ assertThatThrownBy(new ProfileCredentialsUtils(profileFile, profileFile.profiles().get("child"),
profileFile::profile)::credentialsProvider)
.hasMessageContaining("the 'sts' service module must be on the class path");
- Assertions.assertThat(sourceProfile).satisfies(profileValidator);
- Assertions.assertThat(configProfile).satisfies(profileValidator);
+ assertThat(sourceProfile).satisfies(profileValidator);
+ assertThat(configProfile).satisfies(profileValidator);
}
@Test
@@ -79,7 +79,7 @@ public void roleProfileWithMissingSourceThrowsException() {
ProfileFile profileFile = configFile("[profile test]\n" +
"source_profile=source\n" +
"role_arn=arn:aws:iam::123456789012:role/testRole");
- Assertions.assertThatThrownBy(new ProfileCredentialsUtils(profileFile, profileFile.profile("test")
+ assertThatThrownBy(new ProfileCredentialsUtils(profileFile, profileFile.profile("test")
.get(), profileFile::profile)::credentialsProvider)
.hasMessageContaining("source profile has no credentials configured.");
}
@@ -93,7 +93,7 @@ public void roleProfileWithSourceThatHasNoCredentialsThrowsExceptionWhenLoadingC
assertThat(profiles.profile("test")).hasValueSatisfying(profile -> {
ProfileCredentialsUtils profileCredentialsUtils = new ProfileCredentialsUtils(profiles, profile, profiles::profile);
- Assertions.assertThatThrownBy(profileCredentialsUtils::credentialsProvider)
+ assertThatThrownBy(profileCredentialsUtils::credentialsProvider)
.hasMessageContaining("source profile has no credentials configured");
});
}
@@ -132,7 +132,7 @@ public void profileFileWithSessionCredentialsLoadsCorrectly() {
assertThat(credentials).isInstanceOf(AwsSessionCredentials.class);
assertThat(credentials.accessKeyId()).isEqualTo("defaultAccessKey");
assertThat(credentials.secretAccessKey()).isEqualTo("defaultSecretAccessKey");
- Assertions.assertThat(((AwsSessionCredentials) credentials).sessionToken()).isEqualTo("awsSessionToken");
+ assertThat(((AwsSessionCredentials) credentials).sessionToken()).isEqualTo("awsSessionToken");
});
});
});
@@ -160,7 +160,7 @@ public void profileFileWithAssumeRoleThrowsExceptionWhenRetrievingCredentialsPro
assertThat(profile.property(ProfileProperty.REGION)).isNotPresent();
ProfileCredentialsUtils profileCredentialsUtils = new ProfileCredentialsUtils(profileFile, profile, profileFile::profile);
- Assertions.assertThatThrownBy(profileCredentialsUtils::credentialsProvider).isInstanceOf(IllegalStateException.class);
+ assertThatThrownBy(profileCredentialsUtils::credentialsProvider).isInstanceOf(IllegalStateException.class);
});
}
@@ -177,7 +177,7 @@ public void profileFileWithCredentialSourceThrowsExceptionWhenRetrievingCredenti
assertThat(profile.property(ProfileProperty.REGION)).isNotPresent();
ProfileCredentialsUtils profileCredentialsUtils = new ProfileCredentialsUtils(profileFile, profile, profileFile::profile);
- Assertions.assertThatThrownBy(profileCredentialsUtils::credentialsProvider).isInstanceOf(IllegalStateException.class);
+ assertThatThrownBy(profileCredentialsUtils::credentialsProvider).isInstanceOf(IllegalStateException.class);
});
});
}
@@ -199,7 +199,7 @@ public void profileFileWithCircularDependencyThrowsExceptionWhenResolvingCredent
"[profile test3]\n" +
"source_profile=test2\n" +
"role_arn=arn:aws:iam::123456789012:role/testRole3");
- Assertions.assertThatThrownBy(() -> new ProfileCredentialsUtils(configFile, configFile.profile("test").get(), configFile::profile)
+ assertThatThrownBy(() -> new ProfileCredentialsUtils(configFile, configFile.profile("test").get(), configFile::profile)
.credentialsProvider())
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Invalid profile file: Circular relationship detected with profiles");
@@ -215,7 +215,7 @@ public void profileWithBothCredentialSourceAndSourceProfileThrowsException() {
"[profile source]\n" +
"aws_access_key_id=defaultAccessKey\n" +
"aws_secret_access_key=defaultSecretAccessKey");
- Assertions.assertThatThrownBy(() -> new ProfileCredentialsUtils(configFile, configFile.profile("test").get(), configFile::profile)
+ assertThatThrownBy(() -> new ProfileCredentialsUtils(configFile, configFile.profile("test").get(), configFile::profile)
.credentialsProvider())
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Invalid profile file: profile has both source_profile and credential_source.");
@@ -226,7 +226,7 @@ public void profileWithInvalidCredentialSourceThrowsException() {
ProfileFile configFile = configFile("[profile test]\n" +
"credential_source=foobar\n" +
"role_arn=arn:aws:iam::123456789012:role/testRole3");
- Assertions.assertThatThrownBy(() -> new ProfileCredentialsUtils(configFile, configFile.profile("test").get(), configFile::profile)
+ assertThatThrownBy(() -> new ProfileCredentialsUtils(configFile, configFile.profile("test").get(), configFile::profile)
.credentialsProvider())
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("foobar is not a valid credential_source");
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/AbstractAws4SignerTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/AbstractAws4SignerTest.java
index 9b028c2444bf..da099da64b47 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/AbstractAws4SignerTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/AbstractAws4SignerTest.java
@@ -15,9 +15,9 @@
package software.amazon.awssdk.auth.signer;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.signer.internal.AbstractAws4Signer;
public class AbstractAws4SignerTest {
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/Aws4EventStreamSignerTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/Aws4EventStreamSignerTest.java
index eedded3748f9..7414d8ff3f89 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/Aws4EventStreamSignerTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/Aws4EventStreamSignerTest.java
@@ -15,6 +15,7 @@
package software.amazon.awssdk.auth.signer;
+import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
@@ -43,8 +44,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.assertj.core.util.Lists;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
@@ -152,13 +152,13 @@ public void onNext(Object o) {
@Override
public void onError(Throwable t) {
- Assert.fail("onError should never been called");
+ fail("onError should never been called");
}
@Override
public void onComplete() {
- Assert.fail("onComplete should never been called");
+ fail("onComplete should never been called");
}
});
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/EventStreamAws4SignerTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/EventStreamAws4SignerTest.java
index 6c4b8bbec0a2..ce2f2745b77e 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/EventStreamAws4SignerTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/EventStreamAws4SignerTest.java
@@ -15,7 +15,7 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.AwsCredentials;
import software.amazon.awssdk.auth.signer.internal.SignerTestUtils;
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/NonStreamingAsyncBodyAws4SignerTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/NonStreamingAsyncBodyAws4SignerTest.java
index d112676e2ccf..28f94e983a38 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/NonStreamingAsyncBodyAws4SignerTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/NonStreamingAsyncBodyAws4SignerTest.java
@@ -21,6 +21,7 @@
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
+
import io.reactivex.Flowable;
import java.io.ByteArrayInputStream;
import java.nio.ByteBuffer;
@@ -31,7 +32,7 @@
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.mockito.stubbing.Answer;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/Aws4SignerRequestParamsTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/Aws4SignerRequestParamsTest.java
index 8b470001fbb0..41ebf8260680 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/Aws4SignerRequestParamsTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/Aws4SignerRequestParamsTest.java
@@ -16,9 +16,10 @@
package software.amazon.awssdk.auth.signer.internal;
import static org.assertj.core.api.Assertions.assertThat;
+
import java.time.Duration;
import java.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.signer.params.Aws4SignerParams;
import software.amazon.awssdk.regions.Region;
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/BaseEventStreamAsyncAws4SignerTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/BaseEventStreamAsyncAws4SignerTest.java
index 6e78ea6f8f79..1eaca27065c4 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/BaseEventStreamAsyncAws4SignerTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/BaseEventStreamAsyncAws4SignerTest.java
@@ -16,12 +16,13 @@
package software.amazon.awssdk.auth.signer.internal;
import static org.assertj.core.api.Assertions.assertThat;
+
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Random;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.utils.BinaryUtils;
import software.amazon.eventstream.HeaderValue;
import software.amazon.eventstream.Message;
@@ -29,7 +30,7 @@
public class BaseEventStreamAsyncAws4SignerTest {
private static Map headers;
- @BeforeClass
+ @BeforeAll
public static void setup() {
headers = new LinkedHashMap<>();
headers.put("header1", HeaderValue.fromInteger(42));
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/ChunkedEncodingFunctionalTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/ChunkedEncodingFunctionalTest.java
index 9763b2b8d99f..975c0e937469 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/ChunkedEncodingFunctionalTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/ChunkedEncodingFunctionalTest.java
@@ -23,10 +23,10 @@
import java.nio.charset.StandardCharsets;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
-import org.junit.Test;
-import software.amazon.awssdk.core.internal.chunked.AwsChunkedEncodingConfig;
-import software.amazon.awssdk.auth.signer.internal.chunkedencoding.AwsSignedChunkedEncodingInputStream;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.auth.signer.internal.chunkedencoding.AwsS3V4ChunkSigner;
+import software.amazon.awssdk.auth.signer.internal.chunkedencoding.AwsSignedChunkedEncodingInputStream;
+import software.amazon.awssdk.core.internal.chunked.AwsChunkedEncodingConfig;
import software.amazon.awssdk.utils.BinaryUtils;
/**
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/DigestComputingSubscriberTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/DigestComputingSubscriberTest.java
index c82dbec4c673..41bf5b43eb32 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/DigestComputingSubscriberTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/DigestComputingSubscriberTest.java
@@ -21,10 +21,11 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+
import io.reactivex.Flowable;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.reactivestreams.Subscription;
import software.amazon.awssdk.utils.BinaryUtils;
diff --git a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/SignerKeyTest.java b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/SignerKeyTest.java
index 9100c163965c..8109370aeb21 100644
--- a/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/SignerKeyTest.java
+++ b/core/auth/src/test/java/software/amazon/awssdk/auth/signer/internal/SignerKeyTest.java
@@ -16,8 +16,9 @@
package software.amazon.awssdk.auth.signer.internal;
import static org.assertj.core.api.Assertions.assertThat;
+
import java.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class SignerKeyTest {
diff --git a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/client/endpoint/DefaultServiceEndpointBuilderTest.java b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/client/endpoint/DefaultServiceEndpointBuilderTest.java
index 38b65f87a653..4037e5bf1dcf 100644
--- a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/client/endpoint/DefaultServiceEndpointBuilderTest.java
+++ b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/client/endpoint/DefaultServiceEndpointBuilderTest.java
@@ -15,9 +15,9 @@
package software.amazon.awssdk.awscore.client.endpoint;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.awscore.endpoint.DefaultServiceEndpointBuilder;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.regions.ServiceMetadataAdvancedOption;
diff --git a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/eventstream/EventStreamInitialRequestInterceptorTest.java b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/eventstream/EventStreamInitialRequestInterceptorTest.java
index 6d3cd56598da..07d486478163 100644
--- a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/eventstream/EventStreamInitialRequestInterceptorTest.java
+++ b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/eventstream/EventStreamInitialRequestInterceptorTest.java
@@ -15,9 +15,9 @@
package software.amazon.awssdk.awscore.eventstream;
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertSame;
import static org.mockito.Mockito.when;
import static software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute.HAS_INITIAL_REQUEST_EVENT;
import static software.amazon.awssdk.core.internal.util.Mimetype.MIMETYPE_EVENT_STREAM;
@@ -30,7 +30,7 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import software.amazon.awssdk.core.async.AsyncRequestBody;
import software.amazon.awssdk.core.interceptor.Context.ModifyHttpRequest;
diff --git a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsErrorDetailsTest.java b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsErrorDetailsTest.java
index 36c949822e10..f4b140f7688d 100644
--- a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsErrorDetailsTest.java
+++ b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsErrorDetailsTest.java
@@ -15,14 +15,13 @@
package software.amazon.awssdk.awscore.exception;
-import java.io.IOException;
import nl.jqno.equalsverifier.EqualsVerifier;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class AwsErrorDetailsTest {
@Test
- public void equals_hashcode() throws IOException, ClassNotFoundException {
+ public void equals_hashcode() throws Exception {
EqualsVerifier.forClass(AwsErrorDetails.class)
.usingGetClass()
.verify();
diff --git a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsServiceExceptionSerializationTest.java b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsServiceExceptionSerializationTest.java
index e71d1abf86a8..6c7713d4b8e5 100644
--- a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsServiceExceptionSerializationTest.java
+++ b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsServiceExceptionSerializationTest.java
@@ -19,23 +19,19 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.time.Duration;
-import java.util.Collections;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.http.AbortableInputStream;
import software.amazon.awssdk.http.SdkHttpFullResponse;
import software.amazon.awssdk.http.SdkHttpResponse;
-import software.amazon.awssdk.testutils.InputStreamUtils;
-import software.amazon.awssdk.utils.IoUtils;
import software.amazon.awssdk.utils.StringInputStream;
public class AwsServiceExceptionSerializationTest {
@Test
- public void serializeServiceException() throws IOException, ClassNotFoundException {
+ public void serializeServiceException() throws Exception {
AwsServiceException expectedException = createException();
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
diff --git a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsServiceExceptionTest.java b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsServiceExceptionTest.java
index b9e003a4c4e4..189b7c0d9215 100644
--- a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsServiceExceptionTest.java
+++ b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/exception/AwsServiceExceptionTest.java
@@ -19,7 +19,7 @@
import java.time.Duration;
import java.time.Instant;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.http.SdkHttpFullResponse;
import software.amazon.awssdk.http.SdkHttpResponse;
import software.amazon.awssdk.utils.DateUtils;
diff --git a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/interceptor/HelpfulUnknownHostExceptionInterceptorTest.java b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/interceptor/HelpfulUnknownHostExceptionInterceptorTest.java
index 471eedcff9b8..76dc2cc3c465 100644
--- a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/interceptor/HelpfulUnknownHostExceptionInterceptorTest.java
+++ b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/interceptor/HelpfulUnknownHostExceptionInterceptorTest.java
@@ -4,7 +4,7 @@
import java.io.IOException;
import java.net.UnknownHostException;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import software.amazon.awssdk.awscore.AwsExecutionAttribute;
import software.amazon.awssdk.core.SdkRequest;
diff --git a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/internal/defaultsmode/DefaultsModeConfigurationTest.java b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/internal/defaultsmode/DefaultsModeConfigurationTest.java
index e7a2ba9f7b9b..d0fe6e1927c3 100644
--- a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/internal/defaultsmode/DefaultsModeConfigurationTest.java
+++ b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/internal/defaultsmode/DefaultsModeConfigurationTest.java
@@ -18,7 +18,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import java.util.Arrays;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.awscore.defaultsmode.DefaultsMode;
import software.amazon.awssdk.utils.AttributeMap;
diff --git a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/retry/AwsRetryPolicyTest.java b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/retry/AwsRetryPolicyTest.java
index 002e93f81633..38c306d1c4de 100644
--- a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/retry/AwsRetryPolicyTest.java
+++ b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/retry/AwsRetryPolicyTest.java
@@ -15,15 +15,15 @@
package software.amazon.awssdk.awscore.retry;
import static java.time.temporal.ChronoUnit.HOURS;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static software.amazon.awssdk.awscore.retry.AwsRetryPolicy.defaultRetryCondition;
import java.io.IOException;
import java.time.Duration;
import java.time.Instant;
import java.util.function.Consumer;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.awscore.exception.AwsErrorDetails;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.exception.NonRetryableException;
@@ -31,7 +31,6 @@
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.retry.RetryPolicyContext;
import software.amazon.awssdk.http.SdkHttpFullResponse;
-import software.amazon.awssdk.http.SdkHttpResponse;
import software.amazon.awssdk.utils.DateUtils;
public class AwsRetryPolicyTest {
diff --git a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/retry/RetryOnErrorCodeConditionTest.java b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/retry/RetryOnErrorCodeConditionTest.java
index bb72774c6511..229fcf6b1dee 100644
--- a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/retry/RetryOnErrorCodeConditionTest.java
+++ b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/retry/RetryOnErrorCodeConditionTest.java
@@ -15,16 +15,15 @@
package software.amazon.awssdk.awscore.retry;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import com.google.common.collect.Sets;
import java.util.function.Consumer;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.awscore.exception.AwsErrorDetails;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.retry.conditions.RetryOnErrorCodeCondition;
-import software.amazon.awssdk.core.exception.SdkServiceException;
import software.amazon.awssdk.core.retry.RetryPolicyContext;
public class RetryOnErrorCodeConditionTest {
diff --git a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/util/AwsHostNameUtilsTest.java b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/util/AwsHostNameUtilsTest.java
index 91a2cb1cfd90..bd49c77e2667 100644
--- a/core/aws-core/src/test/java/software/amazon/awssdk/awscore/util/AwsHostNameUtilsTest.java
+++ b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/util/AwsHostNameUtilsTest.java
@@ -18,7 +18,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static software.amazon.awssdk.awscore.util.AwsHostNameUtils.parseSigningRegion;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.regions.Region;
/** Unit tests for the utility methods that parse information from AWS URLs. */
diff --git a/core/json-utils/src/test/java/software/amazon/awssdk/protocols/jsoncore/JsonNodeTest.java b/core/json-utils/src/test/java/software/amazon/awssdk/protocols/jsoncore/JsonNodeTest.java
index 756c891a9225..1f79c0d6b605 100644
--- a/core/json-utils/src/test/java/software/amazon/awssdk/protocols/jsoncore/JsonNodeTest.java
+++ b/core/json-utils/src/test/java/software/amazon/awssdk/protocols/jsoncore/JsonNodeTest.java
@@ -4,7 +4,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.utils.StringInputStream;
public class JsonNodeTest {
diff --git a/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/MetricLevelTest.java b/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/MetricLevelTest.java
index 317538e32b16..d265253609e4 100644
--- a/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/MetricLevelTest.java
+++ b/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/MetricLevelTest.java
@@ -17,7 +17,7 @@
import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class MetricLevelTest {
@Test
diff --git a/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultMetricCollectionTest.java b/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultMetricCollectionTest.java
index 65d168b4e1a7..183cb51b12e4 100644
--- a/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultMetricCollectionTest.java
+++ b/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultMetricCollectionTest.java
@@ -25,8 +25,8 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
-import org.junit.AfterClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.metrics.MetricCategory;
import software.amazon.awssdk.metrics.MetricLevel;
import software.amazon.awssdk.metrics.MetricRecord;
@@ -35,7 +35,7 @@
public class DefaultMetricCollectionTest {
private static final SdkMetric M1 = SdkMetric.create("m1", Integer.class, MetricLevel.INFO, MetricCategory.CORE);
- @AfterClass
+ @AfterAll
public static void teardown() {
DefaultSdkMetric.clearDeclaredMetrics();
}
diff --git a/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultMetricCollectorTest.java b/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultMetricCollectorTest.java
index d3f0682d6c8d..1e9abdf09702 100644
--- a/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultMetricCollectorTest.java
+++ b/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultMetricCollectorTest.java
@@ -16,10 +16,11 @@
package software.amazon.awssdk.metrics.internal;
import static org.assertj.core.api.Assertions.assertThat;
+
import java.util.stream.Stream;
-import org.junit.AfterClass;
import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Test;
import org.junit.rules.ExpectedException;
import software.amazon.awssdk.metrics.MetricCategory;
import software.amazon.awssdk.metrics.MetricCollection;
@@ -33,7 +34,7 @@ public class DefaultMetricCollectorTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
- @AfterClass
+ @AfterAll
public static void teardown() {
DefaultSdkMetric.clearDeclaredMetrics();
}
diff --git a/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultSdkMetricRecordTest.java b/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultSdkMetricRecordTest.java
index a6a2fbbc18d6..abca8e23b2c2 100644
--- a/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultSdkMetricRecordTest.java
+++ b/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultSdkMetricRecordTest.java
@@ -16,11 +16,12 @@
package software.amazon.awssdk.metrics.internal;
import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.Test;
+
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.metrics.MetricCategory;
import software.amazon.awssdk.metrics.MetricLevel;
-import software.amazon.awssdk.metrics.SdkMetric;
import software.amazon.awssdk.metrics.MetricRecord;
+import software.amazon.awssdk.metrics.SdkMetric;
/**
* Tests for {@link DefaultMetricRecord}.
diff --git a/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultSdkMetricTest.java b/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultSdkMetricTest.java
index 1fe8d4fbea1a..86dc9a85f68f 100644
--- a/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultSdkMetricTest.java
+++ b/core/metrics-spi/src/test/java/software/amazon/awssdk/metrics/internal/DefaultSdkMetricTest.java
@@ -20,9 +20,9 @@
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.junit.Before;
import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.junit.rules.ExpectedException;
import software.amazon.awssdk.metrics.MetricCategory;
import software.amazon.awssdk.metrics.MetricLevel;
@@ -32,7 +32,7 @@ public class DefaultSdkMetricTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
- @Before
+ @BeforeEach
public void methodSetup() {
DefaultSdkMetric.clearDeclaredMetrics();
}
diff --git a/core/profiles/src/test/java/software/amazon/awssdk/profiles/ProfileFileTest.java b/core/profiles/src/test/java/software/amazon/awssdk/profiles/ProfileFileTest.java
index 116bb48df3e1..6463f10315b7 100644
--- a/core/profiles/src/test/java/software/amazon/awssdk/profiles/ProfileFileTest.java
+++ b/core/profiles/src/test/java/software/amazon/awssdk/profiles/ProfileFileTest.java
@@ -22,7 +22,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Stream;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.utils.StringInputStream;
/**
diff --git a/core/protocols/aws-cbor-protocol/src/test/java/software/amazon/awssdk/protocols/cbor/AwsCborProtocolFactoryTest.java b/core/protocols/aws-cbor-protocol/src/test/java/software/amazon/awssdk/protocols/cbor/AwsCborProtocolFactoryTest.java
index 6cc6cbaf2ccd..961510922379 100644
--- a/core/protocols/aws-cbor-protocol/src/test/java/software/amazon/awssdk/protocols/cbor/AwsCborProtocolFactoryTest.java
+++ b/core/protocols/aws-cbor-protocol/src/test/java/software/amazon/awssdk/protocols/cbor/AwsCborProtocolFactoryTest.java
@@ -22,8 +22,8 @@
import static software.amazon.awssdk.core.traits.TimestampFormatTrait.Format.UNIX_TIMESTAMP_MILLIS;
import java.util.Map;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
@@ -31,7 +31,7 @@ public class AwsCborProtocolFactoryTest {
private static AwsCborProtocolFactory factory;
- @BeforeClass
+ @BeforeAll
public static void setup() {
factory = AwsCborProtocolFactory.builder().build();
}
diff --git a/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/AwsJsonErrorMessageParserTest.java b/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/AwsJsonErrorMessageParserTest.java
index 54e2a89c591e..6e26cad3edda 100644
--- a/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/AwsJsonErrorMessageParserTest.java
+++ b/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/AwsJsonErrorMessageParserTest.java
@@ -15,12 +15,12 @@
package software.amazon.awssdk.protocols.json;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.UUID;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.http.SdkHttpFullResponse;
import software.amazon.awssdk.protocols.json.internal.unmarshall.AwsJsonErrorMessageParser;
import software.amazon.awssdk.protocols.json.internal.unmarshall.ErrorMessageParser;
@@ -40,7 +40,7 @@ public class AwsJsonErrorMessageParserTest {
private JsonNodeParser jsonParser;
- @Before
+ @BeforeEach
public void setup() {
jsonParser = JsonNode.parser();
responseBuilder = ValidSdkObjects.sdkHttpFullResponse();
diff --git a/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/JsonErrorCodeParserTest.java b/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/JsonErrorCodeParserTest.java
index bc814da1d1ad..0a141b494826 100644
--- a/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/JsonErrorCodeParserTest.java
+++ b/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/JsonErrorCodeParserTest.java
@@ -15,11 +15,11 @@
package software.amazon.awssdk.protocols.json;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
import java.io.IOException;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.http.SdkHttpFullResponse;
import software.amazon.awssdk.protocols.json.internal.unmarshall.JsonErrorCodeParser;
import software.amazon.awssdk.protocols.jsoncore.JsonNode;
diff --git a/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/SdkJsonGeneratorTest.java b/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/SdkJsonGeneratorTest.java
index 59058d76f251..5dd5bb32aa7e 100644
--- a/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/SdkJsonGeneratorTest.java
+++ b/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/SdkJsonGeneratorTest.java
@@ -15,17 +15,17 @@
package software.amazon.awssdk.protocols.json;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.time.Instant;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.protocols.jsoncore.JsonNode;
import software.amazon.awssdk.thirdparty.jackson.core.JsonFactory;
import software.amazon.awssdk.utils.BinaryUtils;
@@ -38,7 +38,7 @@ public class SdkJsonGeneratorTest {
private StructuredJsonGenerator jsonGenerator;
- @Before
+ @BeforeEach
public void setup() {
jsonGenerator = new SdkJsonGenerator(JsonFactory.builder().build(), "application/json");
}
@@ -145,17 +145,17 @@ public void testNumericNoQuote() {
// (with no decimal point nor places.)
System.out.println(s);
final String prefix = "{\"foo\":";
- assertTrue(s, s.startsWith(prefix));
+ assertTrue(s.startsWith(prefix), s);
final int startPos = prefix.length();
// verify no starting quote for the value
- assertFalse(s, s.startsWith("{\"foo\":\""));
- assertTrue(s, s.endsWith("}"));
+ assertFalse(s.startsWith("{\"foo\":\""), s);
+ assertTrue(s.endsWith("}"), s);
// Not: {"foo":"1408378076.135"}.
// verify no ending quote for the value
- assertFalse(s, s.endsWith("\"}"));
+ assertFalse(s.endsWith("\"}"), s);
final int endPos = s.indexOf("}");
final int dotPos = s.length() - 5;
- assertTrue(s, s.charAt(dotPos) == '.');
+ assertTrue(s.charAt(dotPos) == '.', s);
// verify all numeric before '.'
char[] a = s.toCharArray();
for (int i = startPos; i < dotPos; i++) {
diff --git a/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/internal/dom/DocumentUnmarshallerTest.java b/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/internal/dom/DocumentUnmarshallerTest.java
index cbd57689cf90..bf6de4cb9059 100644
--- a/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/internal/dom/DocumentUnmarshallerTest.java
+++ b/core/protocols/aws-json-protocol/src/test/java/software/amazon/awssdk/protocols/json/internal/dom/DocumentUnmarshallerTest.java
@@ -3,24 +3,19 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
-
-import org.junit.Test;
-import software.amazon.awssdk.core.SdkNumber;
-import software.amazon.awssdk.core.document.Document;
-import software.amazon.awssdk.protocols.json.internal.unmarshall.document.DocumentUnmarshaller;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.core.SdkNumber;
+import software.amazon.awssdk.core.document.Document;
+import software.amazon.awssdk.protocols.json.internal.unmarshall.document.DocumentUnmarshaller;
import software.amazon.awssdk.protocols.jsoncore.JsonNode;
import software.amazon.awssdk.protocols.jsoncore.internal.EmbeddedObjectJsonNode;
-import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
-import static org.hamcrest.MatcherAssert.assertThat;
-
public class DocumentUnmarshallerTest {
@Test
diff --git a/core/protocols/aws-query-protocol/src/test/java/software/amazon/awssdk/protocols/query/XmlDomParserTest.java b/core/protocols/aws-query-protocol/src/test/java/software/amazon/awssdk/protocols/query/XmlDomParserTest.java
index 16ea0957c23e..365bfd01aa89 100644
--- a/core/protocols/aws-query-protocol/src/test/java/software/amazon/awssdk/protocols/query/XmlDomParserTest.java
+++ b/core/protocols/aws-query-protocol/src/test/java/software/amazon/awssdk/protocols/query/XmlDomParserTest.java
@@ -20,7 +20,7 @@
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import javax.xml.stream.XMLStreamException;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.protocols.query.unmarshall.XmlDomParser;
import software.amazon.awssdk.protocols.query.unmarshall.XmlElement;
diff --git a/core/protocols/aws-query-protocol/src/test/java/software/amazon/awssdk/protocols/query/interceptor/QueryParametersToBodyInterceptorTest.java b/core/protocols/aws-query-protocol/src/test/java/software/amazon/awssdk/protocols/query/interceptor/QueryParametersToBodyInterceptorTest.java
index 2398ab806589..47039837bb4c 100644
--- a/core/protocols/aws-query-protocol/src/test/java/software/amazon/awssdk/protocols/query/interceptor/QueryParametersToBodyInterceptorTest.java
+++ b/core/protocols/aws-query-protocol/src/test/java/software/amazon/awssdk/protocols/query/interceptor/QueryParametersToBodyInterceptorTest.java
@@ -15,8 +15,16 @@
package software.amazon.awssdk.protocols.query.interceptor;
-import org.junit.Before;
-import org.junit.Test;
+import static java.util.Collections.singletonList;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.ByteArrayInputStream;
+import java.net.URI;
+import java.nio.charset.StandardCharsets;
+import java.util.Optional;
+import java.util.stream.Stream;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.Protocol;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.async.AsyncRequestBody;
@@ -28,15 +36,6 @@
import software.amazon.awssdk.http.SdkHttpRequest;
import software.amazon.awssdk.utils.IoUtils;
-import java.io.ByteArrayInputStream;
-import java.net.URI;
-import java.nio.charset.StandardCharsets;
-import java.util.Optional;
-import java.util.stream.Stream;
-
-import static java.util.Collections.singletonList;
-import static org.assertj.core.api.Assertions.assertThat;
-
public class QueryParametersToBodyInterceptorTest {
public static final URI HTTP_LOCALHOST = URI.create("http://localhost:8080");
@@ -46,7 +45,7 @@ public class QueryParametersToBodyInterceptorTest {
private SdkHttpFullRequest.Builder requestBuilder;
- @Before
+ @BeforeEach
public void setup() {
interceptor = new QueryParametersToBodyInterceptor();
diff --git a/core/protocols/aws-xml-protocol/src/test/java/software/amazon/awssdk/protocols/xml/internal/unmarshall/AwsXmlResponseHandlerTest.java b/core/protocols/aws-xml-protocol/src/test/java/software/amazon/awssdk/protocols/xml/internal/unmarshall/AwsXmlResponseHandlerTest.java
index 877324d4496d..f881b0c357fe 100644
--- a/core/protocols/aws-xml-protocol/src/test/java/software/amazon/awssdk/protocols/xml/internal/unmarshall/AwsXmlResponseHandlerTest.java
+++ b/core/protocols/aws-xml-protocol/src/test/java/software/amazon/awssdk/protocols/xml/internal/unmarshall/AwsXmlResponseHandlerTest.java
@@ -22,7 +22,7 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import software.amazon.awssdk.awscore.AwsResponse;
import software.amazon.awssdk.core.SdkField;
diff --git a/core/protocols/aws-xml-protocol/src/test/java/software/amazon/awssdk/protocols/xml/internal/unmarshall/DecorateErrorFromResponseBodyUnmarshallerTest.java b/core/protocols/aws-xml-protocol/src/test/java/software/amazon/awssdk/protocols/xml/internal/unmarshall/DecorateErrorFromResponseBodyUnmarshallerTest.java
index e69c1e585e52..db5fe6cb869b 100644
--- a/core/protocols/aws-xml-protocol/src/test/java/software/amazon/awssdk/protocols/xml/internal/unmarshall/DecorateErrorFromResponseBodyUnmarshallerTest.java
+++ b/core/protocols/aws-xml-protocol/src/test/java/software/amazon/awssdk/protocols/xml/internal/unmarshall/DecorateErrorFromResponseBodyUnmarshallerTest.java
@@ -19,9 +19,7 @@
import java.util.Optional;
import java.util.function.Function;
-
-import org.junit.Test;
-
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.http.SdkHttpFullResponse;
import software.amazon.awssdk.protocols.query.unmarshall.XmlElement;
diff --git a/core/protocols/protocol-core/src/test/java/software/amazon/awssdk/protocols/core/ProtocolUtilsTest.java b/core/protocols/protocol-core/src/test/java/software/amazon/awssdk/protocols/core/ProtocolUtilsTest.java
index ffb7c9048f4e..ce5b33ceb4c0 100644
--- a/core/protocols/protocol-core/src/test/java/software/amazon/awssdk/protocols/core/ProtocolUtilsTest.java
+++ b/core/protocols/protocol-core/src/test/java/software/amazon/awssdk/protocols/core/ProtocolUtilsTest.java
@@ -17,10 +17,12 @@
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.net.URI;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.http.SdkHttpFullRequest;
import software.amazon.awssdk.http.SdkHttpMethod;
@@ -89,13 +91,13 @@ public void createSdkHttpRequest_NoTrailingOrLeadingSlash_RequestUriAppendedToEn
@Test
public void request_null_returns_null() {
- Assert.assertNull(ProtocolUtils.addStaticQueryParametersToRequest(null,
+ assertNull(ProtocolUtils.addStaticQueryParametersToRequest(null,
"foo"));
}
@Test
public void uri_resource_path_null_returns_null() {
- Assert.assertNull(ProtocolUtils
+ assertNull(ProtocolUtils
.addStaticQueryParametersToRequest(emptyRequest(), null));
}
@@ -108,7 +110,7 @@ public void uri_resource_path_doesnot_have_static_query_params_returns_uri_resou
final String uriResourcePath = "/foo/bar";
- Assert.assertEquals(uriResourcePath, ProtocolUtils
+ assertEquals(uriResourcePath, ProtocolUtils
.addStaticQueryParametersToRequest(emptyRequest(), uriResourcePath));
}
@@ -119,7 +121,7 @@ public void uri_resource_path_ends_with_question_mark_returns_path_removed_with_
final String expectedResourcePath = "/foo/bar";
final String pathWithEmptyStaticQueryParams = expectedResourcePath + "?";
- Assert.assertEquals(expectedResourcePath, ProtocolUtils
+ assertEquals(expectedResourcePath, ProtocolUtils
.addStaticQueryParametersToRequest(emptyRequest(), pathWithEmptyStaticQueryParams));
}
@@ -132,11 +134,11 @@ public void queryparam_value_empty_adds_parameter_with_empty_string_to_request()
SdkHttpFullRequest.Builder request = emptyRequest();
- Assert.assertEquals(uriResourcePath, ProtocolUtils
+ assertEquals(uriResourcePath, ProtocolUtils
.addStaticQueryParametersToRequest(request,
uriResourcePathWithParams));
- Assert.assertTrue(request.rawQueryParameters().containsKey("param1"));
- Assert.assertEquals(singletonList(""), request.rawQueryParameters().get("param1"));
+ assertTrue(request.rawQueryParameters().containsKey("param1"));
+ assertEquals(singletonList(""), request.rawQueryParameters().get("param1"));
}
@Test
@@ -146,13 +148,13 @@ public void static_queryparams_in_path_added_to_request() {
uriResourcePath + "?param1=value1¶m2=value2";
SdkHttpFullRequest.Builder request = emptyRequest();
- Assert.assertEquals(uriResourcePath, ProtocolUtils
+ assertEquals(uriResourcePath, ProtocolUtils
.addStaticQueryParametersToRequest(request,
uriResourcePathWithParams));
- Assert.assertTrue(request.rawQueryParameters().containsKey("param1"));
- Assert.assertTrue(request.rawQueryParameters().containsKey("param2"));
- Assert.assertEquals(singletonList("value1"), request.rawQueryParameters().get("param1"));
- Assert.assertEquals(singletonList("value2"), request.rawQueryParameters().get("param2"));
+ assertTrue(request.rawQueryParameters().containsKey("param1"));
+ assertTrue(request.rawQueryParameters().containsKey("param2"));
+ assertEquals(singletonList("value1"), request.rawQueryParameters().get("param1"));
+ assertEquals(singletonList("value2"), request.rawQueryParameters().get("param2"));
}
@@ -163,10 +165,10 @@ public void queryparam_without_value_returns_list_containing_null_value() {
uriResourcePath + "?param";
SdkHttpFullRequest.Builder request = emptyRequest();
- Assert.assertEquals(uriResourcePath, ProtocolUtils.addStaticQueryParametersToRequest(request, uriResourcePathWithParams));
+ assertEquals(uriResourcePath, ProtocolUtils.addStaticQueryParametersToRequest(request, uriResourcePathWithParams));
- Assert.assertTrue(request.rawQueryParameters().containsKey("param"));
- Assert.assertEquals(singletonList((String) null), request.rawQueryParameters().get("param"));
+ assertTrue(request.rawQueryParameters().containsKey("param"));
+ assertEquals(singletonList((String) null), request.rawQueryParameters().get("param"));
}
}
diff --git a/core/regions/src/test/java/software/amazon/awssdk/regions/PartitionEndpointKeyTest.java b/core/regions/src/test/java/software/amazon/awssdk/regions/PartitionEndpointKeyTest.java
index 356038720b92..87521aa7ce63 100644
--- a/core/regions/src/test/java/software/amazon/awssdk/regions/PartitionEndpointKeyTest.java
+++ b/core/regions/src/test/java/software/amazon/awssdk/regions/PartitionEndpointKeyTest.java
@@ -16,7 +16,7 @@
package software.amazon.awssdk.regions;
import nl.jqno.equalsverifier.EqualsVerifier;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class PartitionEndpointKeyTest {
@Test
diff --git a/core/regions/src/test/java/software/amazon/awssdk/regions/PartitionServiceMetadataTest.java b/core/regions/src/test/java/software/amazon/awssdk/regions/PartitionServiceMetadataTest.java
index d82312850906..9378e00e621a 100644
--- a/core/regions/src/test/java/software/amazon/awssdk/regions/PartitionServiceMetadataTest.java
+++ b/core/regions/src/test/java/software/amazon/awssdk/regions/PartitionServiceMetadataTest.java
@@ -18,9 +18,8 @@
import java.util.Arrays;
import java.util.List;
-import java.util.Optional;
import java.util.stream.Collectors;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class PartitionServiceMetadataTest {
diff --git a/core/regions/src/test/java/software/amazon/awssdk/regions/ServiceEndpointKeyTest.java b/core/regions/src/test/java/software/amazon/awssdk/regions/ServiceEndpointKeyTest.java
index 8b88a8e24be6..25161e340517 100644
--- a/core/regions/src/test/java/software/amazon/awssdk/regions/ServiceEndpointKeyTest.java
+++ b/core/regions/src/test/java/software/amazon/awssdk/regions/ServiceEndpointKeyTest.java
@@ -16,7 +16,7 @@
package software.amazon.awssdk.regions;
import nl.jqno.equalsverifier.EqualsVerifier;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class ServiceEndpointKeyTest {
@Test
diff --git a/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/ConnectionUtilsComponentTest.java b/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/ConnectionUtilsComponentTest.java
index 04f3579ef809..6d1427703d68 100644
--- a/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/ConnectionUtilsComponentTest.java
+++ b/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/ConnectionUtilsComponentTest.java
@@ -17,7 +17,6 @@
import static java.util.Collections.emptyMap;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assume.assumeTrue;
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
@@ -27,11 +26,11 @@
import java.net.Inet4Address;
import java.net.URI;
import java.util.Collections;
-import org.junit.After;
import org.junit.ClassRule;
import org.junit.Rule;
-import org.junit.Test;
-import software.amazon.awssdk.regions.internal.util.ConnectionUtils;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Test;
public class ConnectionUtilsComponentTest {
@@ -43,7 +42,7 @@ public class ConnectionUtilsComponentTest {
private final ConnectionUtils sut = ConnectionUtils.create();
- @After
+ @AfterEach
public void cleanup() {
System.getProperties().remove("http.proxyHost");
System.getProperties().remove("http.proxyPort");
@@ -51,7 +50,7 @@ public void cleanup() {
@Test
public void proxiesAreNotUsedEvenIfPropertyIsSet() throws IOException {
- assumeTrue(Inet4Address.getLocalHost().isReachable(100));
+ Assumptions.assumeTrue(Inet4Address.getLocalHost().isReachable(100));
System.getProperties().put("http.proxyHost", "localhost");
System.getProperties().put("http.proxyPort", String.valueOf(mockProxyServer.port()));
HttpURLConnection connection = sut.connectToEndpoint(URI.create("http://" + Inet4Address.getLocalHost().getHostAddress() + ":" + mockServer.port()), emptyMap());
diff --git a/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/EC2MetadataUtilsTest.java b/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/EC2MetadataUtilsTest.java
index 4172db957e78..7e5af1399574 100644
--- a/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/EC2MetadataUtilsTest.java
+++ b/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/EC2MetadataUtilsTest.java
@@ -28,9 +28,9 @@
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.http.Fault;
import com.github.tomakehurst.wiremock.junit.WireMockRule;
-import org.junit.Before;
import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.junit.rules.ExpectedException;
import software.amazon.awssdk.core.SdkSystemSetting;
import software.amazon.awssdk.core.exception.SdkClientException;
@@ -51,7 +51,7 @@ public class EC2MetadataUtilsTest {
@Rule
public WireMockRule mockMetadataEndpoint = new WireMockRule();
- @Before
+ @BeforeEach
public void methodSetup() {
System.setProperty(SdkSystemSetting.AWS_EC2_METADATA_SERVICE_ENDPOINT.property(), "http://localhost:" + mockMetadataEndpoint.port());
EC2MetadataUtils.clearCache();
diff --git a/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/Ec2MetadataUtilsTt0049160280Test.java b/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/Ec2MetadataUtilsTt0049160280Test.java
index f58860822c5f..1d806c672d39 100644
--- a/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/Ec2MetadataUtilsTt0049160280Test.java
+++ b/core/regions/src/test/java/software/amazon/awssdk/regions/internal/util/Ec2MetadataUtilsTt0049160280Test.java
@@ -15,9 +15,10 @@
package software.amazon.awssdk.regions.internal.util;
-import org.junit.Assert;
-import org.junit.Test;
-import software.amazon.awssdk.regions.internal.util.EC2MetadataUtils;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import org.junit.jupiter.api.Test;
public class Ec2MetadataUtilsTt0049160280Test {
private static final String JSON = "{"
@@ -40,15 +41,15 @@ public class Ec2MetadataUtilsTt0049160280Test {
@Test
public void getRegionIntern() throws Exception {
String region = EC2MetadataUtils.doGetEC2InstanceRegion(JSON);
- Assert.assertEquals("us-east-1", region);
+ assertEquals("us-east-1", region);
}
@Test
public void tt0049160280() {
EC2MetadataUtils.InstanceInfo info = EC2MetadataUtils.doGetInstanceInfo(JSON);
String[] billingProducts = info.getBillingProducts();
- Assert.assertTrue(billingProducts.length == 1);
- Assert.assertEquals(billingProducts[0], "bp-6ba54002");
+ assertTrue(billingProducts.length == 1);
+ assertEquals(billingProducts[0], "bp-6ba54002");
}
@Test
@@ -71,8 +72,8 @@ public void devProductCodes() {
+ "}";
EC2MetadataUtils.InstanceInfo info = EC2MetadataUtils.doGetInstanceInfo(JSON);
String[] devpayProductCodes = info.getDevpayProductCodes();
- Assert.assertTrue(devpayProductCodes.length == 2);
- Assert.assertEquals(devpayProductCodes[0], "foo");
- Assert.assertEquals(devpayProductCodes[1], "bar");
+ assertTrue(devpayProductCodes.length == 2);
+ assertEquals(devpayProductCodes[0], "foo");
+ assertEquals(devpayProductCodes[1], "bar");
}
}
diff --git a/core/regions/src/test/java/software/amazon/awssdk/regions/providers/AwsProfileRegionProviderTest.java b/core/regions/src/test/java/software/amazon/awssdk/regions/providers/AwsProfileRegionProviderTest.java
index 1a73d8025b4e..0e6c73d9315e 100644
--- a/core/regions/src/test/java/software/amazon/awssdk/regions/providers/AwsProfileRegionProviderTest.java
+++ b/core/regions/src/test/java/software/amazon/awssdk/regions/providers/AwsProfileRegionProviderTest.java
@@ -21,9 +21,8 @@
import java.net.URISyntaxException;
import java.nio.file.Paths;
import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.exception.SdkClientException;
-import software.amazon.awssdk.profiles.ProfileFile;
import software.amazon.awssdk.profiles.ProfileFileSystemSetting;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.testutils.EnvironmentVariableHelper;
diff --git a/core/regions/src/test/java/software/amazon/awssdk/regions/providers/LazyAwsRegionProviderTest.java b/core/regions/src/test/java/software/amazon/awssdk/regions/providers/LazyAwsRegionProviderTest.java
index 83bff94bdbdc..05134891e45f 100644
--- a/core/regions/src/test/java/software/amazon/awssdk/regions/providers/LazyAwsRegionProviderTest.java
+++ b/core/regions/src/test/java/software/amazon/awssdk/regions/providers/LazyAwsRegionProviderTest.java
@@ -16,8 +16,8 @@
package software.amazon.awssdk.regions.providers;
import java.util.function.Supplier;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
public class LazyAwsRegionProviderTest {
@@ -26,7 +26,7 @@ public class LazyAwsRegionProviderTest {
private AwsRegionProvider regionProvider = Mockito.mock(AwsRegionProvider.class);
- @Before
+ @BeforeEach
public void reset() {
Mockito.reset(regionProvider, regionProviderConstructor);
Mockito.when(regionProviderConstructor.get()).thenReturn(regionProvider);
diff --git a/core/regions/src/test/java/software/amazon/awssdk/regions/servicemetadata/GeneratedServiceMetadataProviderTest.java b/core/regions/src/test/java/software/amazon/awssdk/regions/servicemetadata/GeneratedServiceMetadataProviderTest.java
index 6a99b1e71b7c..c019dd249283 100644
--- a/core/regions/src/test/java/software/amazon/awssdk/regions/servicemetadata/GeneratedServiceMetadataProviderTest.java
+++ b/core/regions/src/test/java/software/amazon/awssdk/regions/servicemetadata/GeneratedServiceMetadataProviderTest.java
@@ -16,7 +16,8 @@
package software.amazon.awssdk.regions.servicemetadata;
import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.Test;
+
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.regions.GeneratedServiceMetadataProvider;
public class GeneratedServiceMetadataProviderTest {
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/RequestOverrideConfigurationTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/RequestOverrideConfigurationTest.java
index 5e9ea642a9ce..729131c87e2e 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/RequestOverrideConfigurationTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/RequestOverrideConfigurationTest.java
@@ -16,7 +16,7 @@
package software.amazon.awssdk.core;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.mock;
import java.time.Duration;
@@ -27,7 +27,7 @@
import java.util.List;
import java.util.Map;
import nl.jqno.equalsverifier.EqualsVerifier;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.interceptor.ExecutionAttribute;
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
import software.amazon.awssdk.core.signer.Signer;
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/ResponseBytesTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/ResponseBytesTest.java
index f41a0179b6ad..f76b86f73ddf 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/ResponseBytesTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/ResponseBytesTest.java
@@ -17,7 +17,7 @@
import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class ResponseBytesTest {
private static final Object OBJECT = new Object();
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/SdkBytesTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/SdkBytesTest.java
index 1503f08ae54b..3a630dfdadf0 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/SdkBytesTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/SdkBytesTest.java
@@ -17,7 +17,7 @@
import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class SdkBytesTest {
@Test
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/SdkNumberTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/SdkNumberTest.java
index cf8e650af200..d475dd6e6216 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/SdkNumberTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/SdkNumberTest.java
@@ -18,10 +18,10 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import org.junit.Test;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Objects;
+import org.junit.jupiter.api.Test;
public class SdkNumberTest {
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/async/SdkPublishersTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/async/SdkPublishersTest.java
index 838ff2af095d..592873971934 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/async/SdkPublishersTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/async/SdkPublishersTest.java
@@ -22,12 +22,10 @@
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
-
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/AsyncClientHandlerExceptionTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/AsyncClientHandlerExceptionTest.java
index fa1e75bd5b0a..633c2b420077 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/AsyncClientHandlerExceptionTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/AsyncClientHandlerExceptionTest.java
@@ -15,8 +15,7 @@
package software.amazon.awssdk.core.client;
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
@@ -27,11 +26,10 @@
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
import java.util.function.Predicate;
import java.util.function.Supplier;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.mockito.stubbing.Answer;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.SdkResponse;
@@ -78,7 +76,7 @@ public class AsyncClientHandlerExceptionTest {
private ClientExecutionParams executionParams;
- @Before
+ @BeforeEach
public void methodSetup() throws Exception {
executionParams = new ClientExecutionParams()
.withInput(request)
@@ -112,7 +110,7 @@ public void methodSetup() throws Exception {
}
@Test
- public void marshallerThrowsReportedThroughFuture() throws ExecutionException, InterruptedException {
+ public void marshallerThrowsReportedThroughFuture() throws Exception {
final SdkClientException e = SdkClientException.create("Could not marshall");
when(marshaller.marshall(any(SdkRequest.class))).thenThrow(e);
doVerify(() -> clientHandler.execute(executionParams), e);
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/ClientOverrideConfigurationTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/ClientOverrideConfigurationTest.java
index 284bb66d6ec0..b1a60552361b 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/ClientOverrideConfigurationTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/ClientOverrideConfigurationTest.java
@@ -16,7 +16,9 @@
package software.amazon.awssdk.core.client.config;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.Mockito.mock;
import java.util.ArrayList;
@@ -25,7 +27,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.interceptor.ExecutionAttribute;
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/ConfigurationBuilderTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/ConfigurationBuilderTest.java
index b50ac6618a06..3b600218ae43 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/ConfigurationBuilderTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/ConfigurationBuilderTest.java
@@ -26,8 +26,7 @@
import java.util.Arrays;
import java.util.Map;
import java.util.Optional;
-import org.junit.Test;
-import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
+import org.junit.jupiter.api.Test;
/**
* Validate the functionality of the Client*Configuration classes
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/SdkClientConfigurationTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/SdkClientConfigurationTest.java
index c943b3eef096..74c94c5bc39a 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/SdkClientConfigurationTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/client/config/SdkClientConfigurationTest.java
@@ -16,7 +16,7 @@
package software.amazon.awssdk.core.client.config;
import nl.jqno.equalsverifier.EqualsVerifier;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
public class SdkClientConfigurationTest {
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/document/DocumentTypeTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/document/DocumentTypeTest.java
index 28733794e390..dad5ed9ca781 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/document/DocumentTypeTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/document/DocumentTypeTest.java
@@ -15,9 +15,8 @@
package software.amazon.awssdk.core.document;
-import org.junit.Test;
-import software.amazon.awssdk.core.SdkNumber;
-import software.amazon.awssdk.core.document.internal.ListDocument;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -29,9 +28,9 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.core.SdkNumber;
+import software.amazon.awssdk.core.document.internal.ListDocument;
public class DocumentTypeTest {
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/exception/SdkExceptionMessageTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/exception/SdkExceptionMessageTest.java
index 55cccdd40bd7..70917c2417c2 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/exception/SdkExceptionMessageTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/exception/SdkExceptionMessageTest.java
@@ -17,7 +17,7 @@
import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
/**
* Verifies the ways in which a message in an {@link SdkException} can be populated.
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/AmazonHttpClientWireMockTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/AmazonHttpClientWireMockTest.java
index 963ae396647f..2a4526711c36 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/AmazonHttpClientWireMockTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/AmazonHttpClientWireMockTest.java
@@ -26,9 +26,8 @@
import static software.amazon.awssdk.core.internal.http.timers.ClientExecutionAndRequestTimerTestUtils.executionContext;
import static software.amazon.awssdk.core.internal.util.ResponseHandlerTestUtils.combinedSyncResponseHandler;
-import org.junit.Before;
-import org.junit.Test;
-
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient;
import software.amazon.awssdk.core.internal.http.response.NullErrorResponseHandler;
import software.amazon.awssdk.http.SdkHttpFullRequest;
@@ -42,7 +41,7 @@ public class AmazonHttpClientWireMockTest extends WireMockTestBase {
private static final String CONFIG_HEADER_VALUE = "client config header value";
private static final String REQUEST_HEADER_VALUE = "request header value";
- @Before
+ @BeforeEach
public void setUp() {
stubFor(any(urlPathEqualTo(OPERATION)).willReturn(aResponse()));
}
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/ContentStreamProviderWireMockTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/ContentStreamProviderWireMockTest.java
index 94f9f91c3237..349b4b0f3eb1 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/ContentStreamProviderWireMockTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/ContentStreamProviderWireMockTest.java
@@ -20,7 +20,7 @@
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.fail;
import static software.amazon.awssdk.core.internal.http.timers.ClientExecutionAndRequestTimerTestUtils.executionContext;
import static software.amazon.awssdk.core.internal.util.ResponseHandlerTestUtils.combinedSyncResponseHandler;
import static software.amazon.awssdk.utils.FunctionalUtils.invokeSafely;
@@ -31,9 +31,7 @@
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
-
-import org.junit.Test;
-
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.exception.SdkServiceException;
import software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient;
import software.amazon.awssdk.core.internal.http.response.NullErrorResponseHandler;
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/SdkTransactionIdInHeaderTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/SdkTransactionIdInHeaderTest.java
index 73dc1f34acfa..2049b68cd51a 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/SdkTransactionIdInHeaderTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/http/SdkTransactionIdInHeaderTest.java
@@ -21,15 +21,13 @@
import static com.github.tomakehurst.wiremock.client.WireMock.getRequestedFor;
import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.fail;
import static software.amazon.awssdk.core.internal.util.ResponseHandlerTestUtils.combinedSyncResponseHandler;
import com.github.tomakehurst.wiremock.verification.LoggedRequest;
-
-import org.junit.Test;
-
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.exception.SdkServiceException;
import software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient;
import software.amazon.awssdk.core.internal.http.pipeline.stages.ApplyTransactionIdStage;
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/interceptor/ExecutionAttributesTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/interceptor/ExecutionAttributesTest.java
index 8a7a8dd6f14a..50b6bc12aede 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/interceptor/ExecutionAttributesTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/interceptor/ExecutionAttributesTest.java
@@ -16,7 +16,8 @@
package software.amazon.awssdk.core.interceptor;
import static org.assertj.core.api.Assertions.assertThat;
-import org.junit.Test;
+
+import org.junit.jupiter.api.Test;
public class ExecutionAttributesTest {
private static final ExecutionAttribute ATTR_1 = new ExecutionAttribute<>("Attr1");
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/ByteArrayAsyncRequestBodyTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/ByteArrayAsyncRequestBodyTest.java
index 6b6ba94f504e..378fbf2f59c3 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/ByteArrayAsyncRequestBodyTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/ByteArrayAsyncRequestBodyTest.java
@@ -15,10 +15,11 @@
package software.amazon.awssdk.core.internal.async;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
import java.nio.ByteBuffer;
import java.util.concurrent.atomic.AtomicBoolean;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import software.amazon.awssdk.core.internal.util.Mimetype;
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/FileAsyncRequestBodyTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/FileAsyncRequestBodyTest.java
index 8e7c231f2b3c..da9daf557e22 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/FileAsyncRequestBodyTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/FileAsyncRequestBodyTest.java
@@ -16,11 +16,10 @@
package software.amazon.awssdk.core.internal.async;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static software.amazon.awssdk.utils.FunctionalUtils.invokeSafely;
import java.io.ByteArrayOutputStream;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
@@ -30,14 +29,12 @@
import java.nio.file.attribute.FileTime;
import java.time.Instant;
import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
import java.util.concurrent.Semaphore;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import software.amazon.awssdk.core.async.AsyncRequestBody;
@@ -49,12 +46,12 @@ public class FileAsyncRequestBodyTest {
private static final long TEST_FILE_SIZE = 10 * MiB;
private static Path testFile;
- @Before
+ @BeforeEach
public void setup() throws IOException {
testFile = new RandomTempFile(TEST_FILE_SIZE).toPath();
}
- @After
+ @AfterEach
public void teardown() throws IOException {
try {
Files.delete(testFile);
@@ -66,7 +63,7 @@ public void teardown() throws IOException {
// If we issue just enough requests to read the file entirely but not more (to go past EOF), we should still receive
// an onComplete
@Test
- public void readFully_doesNotRequestPastEndOfFile_receivesComplete() throws InterruptedException, ExecutionException, TimeoutException {
+ public void readFully_doesNotRequestPastEndOfFile_receivesComplete() throws Exception {
int chunkSize = 16384;
AsyncRequestBody asyncRequestBody = FileAsyncRequestBody.builder()
.path(testFile)
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/FileAsyncResponseTransformerTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/FileAsyncResponseTransformerTest.java
index 47684bd4b280..53b72e8f9226 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/FileAsyncResponseTransformerTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/async/FileAsyncResponseTransformerTest.java
@@ -28,9 +28,9 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.lang3.RandomStringUtils;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import software.amazon.awssdk.core.async.SdkPublisher;
@@ -41,12 +41,12 @@
public class FileAsyncResponseTransformerTest {
private static FileSystem testFs;
- @BeforeClass
+ @BeforeAll
public static void setup() {
testFs = Jimfs.newFileSystem();
}
- @AfterClass
+ @AfterAll
public static void teardown() throws IOException {
testFs.close();
}
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/pipeline/stages/ExceptionReportingUtilsTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/pipeline/stages/ExceptionReportingUtilsTest.java
index 4742dcfb3a5d..68ddd4379601 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/pipeline/stages/ExceptionReportingUtilsTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/pipeline/stages/ExceptionReportingUtilsTest.java
@@ -20,7 +20,7 @@
import java.util.Arrays;
import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.exception.ApiCallTimeoutException;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.ExecutionContext;
diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/pipeline/stages/RetryableStageAdaptiveModeTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/pipeline/stages/RetryableStageAdaptiveModeTest.java
index 0f8e46827c9b..3e6033443702 100644
--- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/pipeline/stages/RetryableStageAdaptiveModeTest.java
+++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/pipeline/stages/RetryableStageAdaptiveModeTest.java
@@ -26,8 +26,8 @@
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import software.amazon.awssdk.core.Response;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
@@ -55,7 +55,7 @@ public class RetryableStageAdaptiveModeTest {
private RetryableStage