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..0a3adc365b5b 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 @@ -17,7 +17,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.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..cee0f0192a6b 100644 --- a/codegen/src/test/java/software/amazon/awssdk/codegen/IntermediateModelBuilderTest.java +++ b/codegen/src/test/java/software/amazon/awssdk/codegen/IntermediateModelBuilderTest.java @@ -21,7 +21,7 @@ import static org.junit.Assert.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..af03d93000fb 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.jupiter.api.BeforeAll; import org.junit.Rule; -import org.junit.Test; +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/PoetGeneratorTaskIntegrationTest.java b/codegen/src/test/java/software/amazon/awssdk/codegen/emitters/PoetGeneratorTaskIntegrationTest.java index 682ad59434d3..3633bccc45be 100644 --- a/codegen/src/test/java/software/amazon/awssdk/codegen/emitters/PoetGeneratorTaskIntegrationTest.java +++ b/codegen/src/test/java/software/amazon/awssdk/codegen/emitters/PoetGeneratorTaskIntegrationTest.java @@ -31,8 +31,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.codegen.poet.ClassSpec; public final class PoetGeneratorTaskIntegrationTest { @@ -54,7 +54,7 @@ public void canGenerateJavaClass() throws Exception { assertThat(contents, both(containsString(PACKAGE)).and(startsWith(fileHeader))); } - @After + @AfterEach public void cleanUp() { tempDirectories.forEach(safeConsumer(tempDir -> { List files = Files.walk(Paths.get(tempDir)).collect(toList()); 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..6700a919b9ee 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 @@ -16,7 +16,7 @@ import org.hamcrest.Matchers; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DocumentationUtilsTest { 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..9f94feac0987 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 @@ -21,7 +21,7 @@ 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/client/PoetClientFunctionalTests.java b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/client/PoetClientFunctionalTests.java index 5c51f2a88818..f8d5231b85c5 100644 --- a/codegen/src/test/java/software/amazon/awssdk/codegen/poet/client/PoetClientFunctionalTests.java +++ b/codegen/src/test/java/software/amazon/awssdk/codegen/poet/client/PoetClientFunctionalTests.java @@ -18,7 +18,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.ClassSpec; 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/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-simple-methods-integ-class.java b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-simple-methods-integ-class.java index 45f038006a2d..08d55aaa9dc3 100644 --- a/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-simple-methods-integ-class.java +++ b/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-simple-methods-integ-class.java @@ -1,7 +1,7 @@ package software.amazon.awssdk.services.json; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.annotations.Generated; import software.amazon.awssdk.regions.Region; @@ -9,7 +9,7 @@ public class SimpleMethodsIntegrationTest { private static JsonClient client; - @BeforeClass + @BeforeAll public static void setup() { if (JsonClient.serviceMetadata().regions().isEmpty()) { client = JsonClient.builder().region(Region.US_EAST_1).build(); 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..4f89a3de9eef 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 @@ -9,8 +9,8 @@ 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.core.internal.chunked.AwsChunkedEncodingConfig; import software.amazon.awssdk.auth.signer.internal.chunkedencoding.AwsSignedChunkedEncodingInputStream; import software.amazon.awssdk.authcrt.signer.SignerTestUtils; @@ -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..e0a804c74998 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 @@ -21,8 +21,8 @@ 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..bc7f9b550551 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 @@ -18,7 +18,7 @@ import static org.junit.Assert.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..b51e3a9f944a 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 @@ -19,8 +19,8 @@ import static org.junit.Assert.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..a890eb30844e 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 @@ -20,7 +20,7 @@ import static org.junit.Assert.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..baf8d6a381ba 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.jupiter.api.BeforeAll; import org.junit.ClassRule; -import org.junit.Test; +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..f78a2ee11336 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 @@ -30,10 +30,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.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +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 +56,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..74e027d9206c 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,7 @@ 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..68ad634ae676 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 @@ -22,9 +22,9 @@ 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); 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..b1357c2c6345 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 @@ -17,7 +17,7 @@ import static org.junit.Assert.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..c6bbcf847340 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 @@ -44,7 +44,7 @@ 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; 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..cf921209ef7e 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 @@ -31,7 +31,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..6a01da3c0c22 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 @@ -18,7 +18,7 @@ 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..3e4db4643c09 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 @@ -20,8 +20,8 @@ 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 +29,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..9e212f401499 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,7 +23,7 @@ import java.nio.charset.StandardCharsets; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.internal.chunked.AwsChunkedEncodingConfig; import software.amazon.awssdk.auth.signer.internal.chunkedencoding.AwsSignedChunkedEncodingInputStream; import software.amazon.awssdk.auth.signer.internal.chunkedencoding.AwsS3V4ChunkSigner; 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..6de4c9e9e89e 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 @@ -24,7 +24,7 @@ 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..79fd189545f9 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 @@ -17,7 +17,7 @@ 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 90fa1f40034d..6cdeebacaf56 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 @@ -17,7 +17,7 @@ import static org.junit.Assert.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.awscore.endpoint.DefaultServiceEndpointBuilder; import software.amazon.awssdk.regions.Region; 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..f183be466501 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 @@ -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..21c01b8a9388 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 @@ -17,7 +17,7 @@ import java.io.IOException; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class AwsErrorDetailsTest { 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..9d3468790562 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 @@ -23,13 +23,10 @@ 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 { 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/retry/AwsRetryPolicyTest.java b/core/aws-core/src/test/java/software/amazon/awssdk/awscore/retry/AwsRetryPolicyTest.java index 002e93f81633..95ee02785d4b 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 @@ -23,7 +23,7 @@ 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..ccbee65190b6 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 @@ -20,11 +20,10 @@ 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..642e3055bd24 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 @@ -17,9 +17,9 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.stream.Stream; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.Rule; -import org.junit.Test; +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 +33,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..aee4412df13c 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,7 +16,7 @@ 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; 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..70eb68dfdf25 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.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +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..7107fd21c3b6 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 @@ -19,8 +19,8 @@ import static org.junit.Assert.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..ba4e1ee914d3 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 @@ -19,7 +19,7 @@ import static org.junit.Assert.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..58d6e1caf8cf 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 @@ -24,8 +24,8 @@ 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"); } 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..c85760d3258b 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 @@ -4,21 +4,19 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; -import org.junit.Test; +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 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 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; 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..8f92a2f5772f 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,8 @@ package software.amazon.awssdk.protocols.query.interceptor; -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.Protocol; import software.amazon.awssdk.core.SdkRequest; import software.amazon.awssdk.core.async.AsyncRequestBody; @@ -46,7 +46,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..4262e1ba06ef 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 @@ -20,7 +20,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..cabe14135ab4 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 @@ -20,7 +20,7 @@ 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; 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..d33f325cc539 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 @@ -27,11 +27,10 @@ import java.net.Inet4Address; import java.net.URI; import java.util.Collections; -import org.junit.After; +import org.junit.jupiter.api.AfterEach; 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.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"); 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 e24b403e542c..26e824753e7f 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 @@ -26,9 +26,9 @@ import static org.assertj.core.api.Assertions.assertThat; import com.github.tomakehurst.wiremock.client.WireMock; import com.github.tomakehurst.wiremock.junit.WireMockRule; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.core.SdkSystemSetting; import software.amazon.awssdk.core.exception.SdkClientException; @@ -49,7 +49,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..20c434f5ddf8 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 @@ -16,8 +16,7 @@ package software.amazon.awssdk.regions.internal.util; import org.junit.Assert; -import org.junit.Test; -import software.amazon.awssdk.regions.internal.util.EC2MetadataUtils; +import org.junit.jupiter.api.Test; public class Ec2MetadataUtilsTt0049160280Test { private static final String JSON = "{" 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/EnhancedS3ServiceMetadataTest.java b/core/regions/src/test/java/software/amazon/awssdk/regions/servicemetadata/EnhancedS3ServiceMetadataTest.java index 062592471266..3f797a57d262 100644 --- a/core/regions/src/test/java/software/amazon/awssdk/regions/servicemetadata/EnhancedS3ServiceMetadataTest.java +++ b/core/regions/src/test/java/software/amazon/awssdk/regions/servicemetadata/EnhancedS3ServiceMetadataTest.java @@ -20,8 +20,8 @@ import java.net.URI; import java.net.URISyntaxException; import java.nio.file.Paths; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkSystemSetting; import software.amazon.awssdk.profiles.ProfileFile; import software.amazon.awssdk.profiles.ProfileFileSystemSetting; @@ -35,7 +35,7 @@ public class EnhancedS3ServiceMetadataTest { private EnhancedS3ServiceMetadata enhancedMetadata = new EnhancedS3ServiceMetadata(); - @After + @AfterEach public void methodSetup() { ENVIRONMENT_VARIABLE_HELPER.reset(); System.clearProperty(ProfileFileSystemSetting.AWS_PROFILE.property()); 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..cf3bd6a7c6d8 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 @@ -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..8a93c9e49a92 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,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 java.math.BigDecimal; import java.math.BigInteger; import java.util.Objects; 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..afb5bd94936b 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 @@ -27,7 +27,7 @@ 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..9ebc90c41838 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 @@ -30,8 +30,8 @@ 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 +78,7 @@ public class AsyncClientHandlerExceptionTest { private ClientExecutionParams executionParams; - @Before + @BeforeEach public void methodSetup() throws Exception { executionParams = new ClientExecutionParams() .withInput(request) 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..38bec8f10d46 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 @@ -25,7 +25,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/document/DocumentTypeTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/document/DocumentTypeTest.java index 28733794e390..57f3bd8ec067 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,7 +15,7 @@ package software.amazon.awssdk.core.document; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkNumber; import software.amazon.awssdk.core.document.internal.ListDocument; 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..42941893d138 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,9 @@ 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 +42,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..da98831c351a 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 @@ -32,7 +32,7 @@ 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; 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..fe5f7efe98f6 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 @@ -28,8 +28,7 @@ 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..ef92467ddc69 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,7 @@ 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..ee9e1192c9ae 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 @@ -18,7 +18,7 @@ import static org.junit.Assert.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..bd50fcf64be5 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 @@ -20,7 +20,6 @@ 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; @@ -35,9 +34,9 @@ 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 +48,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); 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 retryableStage; - @Before + @BeforeEach public void setup() throws Exception { tokenBucket = spy(RateLimitingTokenBucket.class); mockChildPipeline = mock(RequestPipeline.class); diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/AsyncHttpClientApiCallTimeoutTests.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/AsyncHttpClientApiCallTimeoutTests.java index 50c47c953bee..69300a2f6930 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/AsyncHttpClientApiCallTimeoutTests.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/AsyncHttpClientApiCallTimeoutTests.java @@ -35,9 +35,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.exception.ApiCallAttemptTimeoutException; import software.amazon.awssdk.core.exception.ApiCallTimeoutException; @@ -63,7 +63,7 @@ public class AsyncHttpClientApiCallTimeoutTests { private AmazonAsyncHttpClient httpClient; - @Before + @BeforeEach public void setup() { httpClient = testAsyncClientBuilder() .retryPolicy(RetryPolicy.none()) diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/HttpClientApiCallAttemptTimeoutTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/HttpClientApiCallAttemptTimeoutTest.java index b0f0ee487e66..068fcb473f2a 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/HttpClientApiCallAttemptTimeoutTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/HttpClientApiCallAttemptTimeoutTest.java @@ -32,10 +32,10 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.exception.ApiCallAttemptTimeoutException; import software.amazon.awssdk.core.http.ExecutionContext; import software.amazon.awssdk.core.http.NoopTestRequest; @@ -59,7 +59,7 @@ public class HttpClientApiCallAttemptTimeoutTest { private AmazonSyncHttpClient httpClient; - @Before + @BeforeEach public void setup() { httpClient = testClientBuilder() .retryPolicy(RetryPolicy.none()) diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/HttpClientApiCallTimeoutTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/HttpClientApiCallTimeoutTest.java index 937d3bf851cb..38fb0560a14f 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/HttpClientApiCallTimeoutTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/HttpClientApiCallTimeoutTest.java @@ -32,10 +32,10 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.exception.ApiCallTimeoutException; import software.amazon.awssdk.core.http.ExecutionContext; import software.amazon.awssdk.core.http.NoopTestRequest; @@ -59,7 +59,7 @@ public class HttpClientApiCallTimeoutTest { private AmazonSyncHttpClient httpClient; - @Before + @BeforeEach public void setup() { httpClient = testClientBuilder() .retryPolicy(RetryPolicy.none()) diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/SyncTimeoutTaskTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/SyncTimeoutTaskTest.java index 27a4b027974f..ee0a11109bd7 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/SyncTimeoutTaskTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/http/timers/SyncTimeoutTaskTest.java @@ -21,13 +21,13 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicBoolean; -import org.junit.AfterClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Test; public class SyncTimeoutTaskTest { private static final ExecutorService EXEC = Executors.newSingleThreadExecutor(); - @AfterClass + @AfterAll public static void teardown() { EXEC.shutdown(); } diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/io/BufferedInputStreamResetTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/io/BufferedInputStreamResetTest.java index 9d2a1dd1a760..071cdd8b8ace 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/io/BufferedInputStreamResetTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/io/BufferedInputStreamResetTest.java @@ -21,7 +21,7 @@ import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * This test demonstrates why we should call mark(Integer.MAX_VALUE) instead of diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/retry/ClockSkewAdjusterTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/retry/ClockSkewAdjusterTest.java index ee057515a8d0..d18e48ce1d3d 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/retry/ClockSkewAdjusterTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/retry/ClockSkewAdjusterTest.java @@ -22,7 +22,7 @@ import java.time.Instant; import java.time.temporal.ChronoUnit; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.http.SdkHttpFullResponse; import software.amazon.awssdk.utils.DateUtils; diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/retry/RateLimitingTokenBucketTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/retry/RateLimitingTokenBucketTest.java index d3b1d6f85a58..6afceb1c0c72 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/retry/RateLimitingTokenBucketTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/retry/RateLimitingTokenBucketTest.java @@ -19,7 +19,7 @@ import java.time.Duration; import java.util.concurrent.TimeUnit; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; public class RateLimitingTokenBucketTest { diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/sync/FileContentStreamProviderTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/sync/FileContentStreamProviderTest.java index 9b6c9e1c83c1..a4be2795ab69 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/sync/FileContentStreamProviderTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/sync/FileContentStreamProviderTest.java @@ -25,9 +25,9 @@ import java.nio.file.FileSystem; import java.nio.file.Files; import java.nio.file.Path; -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; /** * Tests for {@link FileContentStreamProvider}. @@ -36,7 +36,7 @@ public class FileContentStreamProviderTest { private static FileSystem testFs; private static Path testFile; - @BeforeClass + @BeforeAll public static void setup() throws IOException { testFs = Jimfs.newFileSystem("FileContentStreamProviderTest"); testFile = testFs.getPath("test_file.dat"); @@ -46,7 +46,7 @@ public static void setup() throws IOException { } } - @AfterClass + @AfterAll public static void teardown() throws IOException { testFs.close(); } diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/CapacityManagerTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/CapacityManagerTest.java index 8e1c66f44522..d678cb2813bc 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/CapacityManagerTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/CapacityManagerTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.core.internal.util; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Tests the behavior of the {@link CapacityManager} diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/MetricUtilsTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/MetricUtilsTest.java index b32a543a7404..c73ec6d3b8dd 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/MetricUtilsTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/MetricUtilsTest.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.time.Duration; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.core.http.HttpResponseHandler; import software.amazon.awssdk.core.metrics.CoreMetric; diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/MimetypeTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/MimetypeTest.java index a4dbd7df4611..95406a1f119c 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/MimetypeTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/util/MimetypeTest.java @@ -20,14 +20,14 @@ import static org.mockito.Mockito.when; import java.nio.file.Path; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class MimetypeTest { private static Mimetype mimetype; - @BeforeClass + @BeforeAll public static void setup() { mimetype = Mimetype.getInstance(); } diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/waiters/WaiterConfigurationTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/waiters/WaiterConfigurationTest.java index f0db2165ff96..8993d554f5dc 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/waiters/WaiterConfigurationTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/internal/waiters/WaiterConfigurationTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.time.Duration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.retry.backoff.BackoffStrategy; import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy; import software.amazon.awssdk.core.waiters.WaiterOverrideConfiguration; diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/DefaultRetryConditionTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/DefaultRetryConditionTest.java index 038f1ad53d95..1aa0ab9322b6 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/DefaultRetryConditionTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/DefaultRetryConditionTest.java @@ -19,7 +19,7 @@ import java.io.IOException; import java.util.function.Consumer; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.exception.NonRetryableException; import software.amazon.awssdk.core.exception.RetryableException; import software.amazon.awssdk.core.exception.SdkClientException; diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/FixedDelayBackoffStrategyTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/FixedDelayBackoffStrategyTest.java index 9bf82d503f58..3a4d12e79ff6 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/FixedDelayBackoffStrategyTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/FixedDelayBackoffStrategyTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.assertEquals; import java.time.Duration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy; public class FixedDelayBackoffStrategyTest { diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/MaxNumberOfRetriesConditionTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/MaxNumberOfRetriesConditionTest.java index 6034e9e86d04..653ce5fb8b31 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/MaxNumberOfRetriesConditionTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/MaxNumberOfRetriesConditionTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.retry.conditions.MaxNumberOfRetriesCondition; public class MaxNumberOfRetriesConditionTest { diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/RetryPolicyContextTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/RetryPolicyContextTest.java index f460c9232de1..5d356534d5c1 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/RetryPolicyContextTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/RetryPolicyContextTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkRequest; import software.amazon.awssdk.core.exception.SdkClientException; import software.amazon.awssdk.core.http.NoopTestRequest; diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/backoff/EqualJitterBackoffStrategyTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/backoff/EqualJitterBackoffStrategyTest.java index 8e5723e140bb..e5d3aa2cbdc5 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/backoff/EqualJitterBackoffStrategyTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/backoff/EqualJitterBackoffStrategyTest.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.core.retry.backoff; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mock; import software.amazon.awssdk.core.retry.RetryPolicyContext; diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/conditions/TokenBucketRetryConditionTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/conditions/TokenBucketRetryConditionTest.java index 1c9b6965d861..9c7f88a66a2c 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/conditions/TokenBucketRetryConditionTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/retry/conditions/TokenBucketRetryConditionTest.java @@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.exception.SdkClientException; import software.amazon.awssdk.core.exception.SdkException; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/sync/RequestBodyTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/sync/RequestBodyTest.java index 2959646885eb..e8be2a64c23f 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/sync/RequestBodyTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/sync/RequestBodyTest.java @@ -30,7 +30,7 @@ import java.nio.file.Files; import java.nio.file.Path; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.TemporaryFolder; import software.amazon.awssdk.core.internal.util.Mimetype; import software.amazon.awssdk.utils.IoUtils; diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/Crc32ChecksumInputStreamTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/Crc32ChecksumInputStreamTest.java index c7e31c9ffd24..a4a970e0b121 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/Crc32ChecksumInputStreamTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/Crc32ChecksumInputStreamTest.java @@ -20,7 +20,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.zip.CRC32; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.internal.util.Crc32ChecksumCalculatingInputStream; /** diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/DefaultSdkAutoConstructListTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/DefaultSdkAutoConstructListTest.java index d831b8bef3ff..ed9c86963d9c 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/DefaultSdkAutoConstructListTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/DefaultSdkAutoConstructListTest.java @@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.LinkedList; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DefaultSdkAutoConstructListTest { private static final DefaultSdkAutoConstructList INSTANCE = DefaultSdkAutoConstructList.getInstance(); diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/DefaultSdkAutoConstructMapTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/DefaultSdkAutoConstructMapTest.java index 5293670c466b..d2c807c4f521 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/DefaultSdkAutoConstructMapTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/DefaultSdkAutoConstructMapTest.java @@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.HashMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DefaultSdkAutoConstructMapTest { private static final DefaultSdkAutoConstructMap AUTO_CONSTRUCT_MAP = DefaultSdkAutoConstructMap.getInstance(); diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/IdempotentUtilsTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/IdempotentUtilsTest.java index e1ba62ec6a31..349e938d1e3c 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/IdempotentUtilsTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/IdempotentUtilsTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class IdempotentUtilsTest { diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/PaginatorUtilsTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/PaginatorUtilsTest.java index a30b176b2118..97da6ef72ef0 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/PaginatorUtilsTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/PaginatorUtilsTest.java @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class PaginatorUtilsTest { diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/RetryUtilsTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/RetryUtilsTest.java index f19b2d7d9252..76f28b527fd1 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/RetryUtilsTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/RetryUtilsTest.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.core.exception.SdkClientException; import software.amazon.awssdk.core.exception.SdkServiceException; import software.amazon.awssdk.core.retry.RetryUtils; diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/SdkUserAgentTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/SdkUserAgentTest.java index 4d4430833fa2..7b7622e3889f 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/SdkUserAgentTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/SdkUserAgentTest.java @@ -19,8 +19,7 @@ import static org.junit.Assert.assertNotNull; import java.util.Arrays; -import org.junit.Test; -import software.amazon.awssdk.core.util.SdkUserAgent; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.utils.JavaSystemSetting; public class SdkUserAgentTest { diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/ThrowableUtilsTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/ThrowableUtilsTest.java index 44f9cd5dc728..dfc2f832a6eb 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/ThrowableUtilsTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/ThrowableUtilsTest.java @@ -18,7 +18,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.internal.util.ThrowableUtils; public class ThrowableUtilsTest { diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/VersionInfoTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/VersionInfoTest.java index 2b4accf0dc0b..baa291ceef61 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/VersionInfoTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/util/VersionInfoTest.java @@ -24,7 +24,7 @@ import java.nio.file.Paths; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.junit.Test; +import org.junit.jupiter.api.Test; public final class VersionInfoTest { diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/AsyncWaiterTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/AsyncWaiterTest.java index d54e2a01abd7..9c1309e9831d 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/AsyncWaiterTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/AsyncWaiterTest.java @@ -23,7 +23,7 @@ import java.util.concurrent.CompletionException; import java.util.function.BiFunction; import java.util.function.Supplier; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.retry.backoff.BackoffStrategy; import software.amazon.awssdk.utils.CompletableFutureUtils; diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/BaseWaiterTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/BaseWaiterTest.java index 5ed83a1ab979..f2b74f919e04 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/BaseWaiterTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/BaseWaiterTest.java @@ -25,9 +25,9 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.function.BiFunction; -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.core.retry.backoff.BackoffStrategy; import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy; @@ -37,12 +37,12 @@ public abstract class BaseWaiterTest { static final String NON_SUCCESS_STATE_MESSAGE = "other"; static ScheduledExecutorService executorService; - @BeforeClass + @BeforeAll public static void setUp() { executorService = Executors.newScheduledThreadPool(2); } - @AfterClass + @AfterAll public static void tearDown() { executorService.shutdown(); } diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/WaiterOverrideConfigurationTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/WaiterOverrideConfigurationTest.java index d82004ff3051..f780fc2673f0 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/WaiterOverrideConfigurationTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/WaiterOverrideConfigurationTest.java @@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.time.Duration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.retry.backoff.BackoffStrategy; import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy; diff --git a/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/WaiterTest.java b/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/WaiterTest.java index 5f4a7873e8ea..6842423a3ab9 100644 --- a/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/WaiterTest.java +++ b/core/sdk-core/src/test/java/software/amazon/awssdk/core/waiters/WaiterTest.java @@ -22,8 +22,8 @@ import java.util.concurrent.CompletableFuture; import java.util.function.BiFunction; 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 software.amazon.awssdk.core.retry.backoff.BackoffStrategy; import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy; @@ -33,7 +33,7 @@ public class WaiterTest extends BaseWaiterTest { private static final String NON_SUCCESS_STATE_MESSAGE = "other"; private BackoffStrategy backoffStrategy; - @Before + @BeforeEach public void setup() { backoffStrategy = FixedDelayBackoffStrategy.create(Duration.ofMillis(10)); } diff --git a/http-client-spi/src/test/java/software/amazon/awssdk/http/ClientTlsAuthTestBase.java b/http-client-spi/src/test/java/software/amazon/awssdk/http/ClientTlsAuthTestBase.java index cdbbee02a96e..b882f5a1f80c 100644 --- a/http-client-spi/src/test/java/software/amazon/awssdk/http/ClientTlsAuthTestBase.java +++ b/http-client-spi/src/test/java/software/amazon/awssdk/http/ClientTlsAuthTestBase.java @@ -19,8 +19,8 @@ import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; abstract class ClientTlsAuthTestBase { protected static final String STORE_PASSWORD = "password"; @@ -32,13 +32,13 @@ abstract class ClientTlsAuthTestBase { protected static Path serverKeyStore; protected static Path clientKeyStore; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { tempDir = Files.createTempDirectory(ClientTlsAuthTestBase.class.getSimpleName()); copyCertsToTmpDir(); } - @AfterClass + @AfterAll public static void teardown() throws IOException { Files.deleteIfExists(serverKeyStore); Files.deleteIfExists(clientKeyStore); diff --git a/http-client-spi/src/test/java/software/amazon/awssdk/http/HttpStatusFamilyTest.java b/http-client-spi/src/test/java/software/amazon/awssdk/http/HttpStatusFamilyTest.java index 3ddd51b6a8ae..b8cb9292cd4e 100644 --- a/http-client-spi/src/test/java/software/amazon/awssdk/http/HttpStatusFamilyTest.java +++ b/http-client-spi/src/test/java/software/amazon/awssdk/http/HttpStatusFamilyTest.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 HttpStatusFamilyTest { @Test diff --git a/http-client-spi/src/test/java/software/amazon/awssdk/http/SdkHttpRequestResponseTest.java b/http-client-spi/src/test/java/software/amazon/awssdk/http/SdkHttpRequestResponseTest.java index 875e664d4303..e6833c4e0077 100644 --- a/http-client-spi/src/test/java/software/amazon/awssdk/http/SdkHttpRequestResponseTest.java +++ b/http-client-spi/src/test/java/software/amazon/awssdk/http/SdkHttpRequestResponseTest.java @@ -23,7 +23,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.net.URI; -import java.net.URISyntaxException; import java.util.AbstractMap; import java.util.Arrays; import java.util.LinkedHashMap; @@ -31,7 +30,7 @@ import java.util.Map; import java.util.function.Consumer; import java.util.function.Supplier; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Verify that {@link DefaultSdkHttpFullRequest} and {@link DefaultSdkHttpFullResponse} properly fulfill the contracts in their diff --git a/http-client-spi/src/test/java/software/amazon/awssdk/http/SystemPropertyTlsKeyManagersProviderTest.java b/http-client-spi/src/test/java/software/amazon/awssdk/http/SystemPropertyTlsKeyManagersProviderTest.java index ec9a4e0e1bb2..338a415e3e79 100644 --- a/http-client-spi/src/test/java/software/amazon/awssdk/http/SystemPropertyTlsKeyManagersProviderTest.java +++ b/http-client-spi/src/test/java/software/amazon/awssdk/http/SystemPropertyTlsKeyManagersProviderTest.java @@ -22,27 +22,27 @@ import java.io.IOException; import java.nio.file.Paths; import java.security.Security; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; public class SystemPropertyTlsKeyManagersProviderTest extends ClientTlsAuthTestBase { private static final SystemPropertyTlsKeyManagersProvider PROVIDER = SystemPropertyTlsKeyManagersProvider.create(); - @BeforeClass + @BeforeAll public static void setUp() throws IOException { ClientTlsAuthTestBase.setUp(); } - @After + @AfterEach public void methodTeardown() { System.clearProperty(SSL_KEY_STORE.property()); System.clearProperty(SSL_KEY_STORE_TYPE.property()); System.clearProperty(SSL_KEY_STORE_PASSWORD.property()); } - @AfterClass + @AfterAll public static void teardown() throws IOException { ClientTlsAuthTestBase.teardown(); } diff --git a/http-client-spi/src/test/java/software/amazon/awssdk/http/TlsKeyManagersProviderTest.java b/http-client-spi/src/test/java/software/amazon/awssdk/http/TlsKeyManagersProviderTest.java index be97ba0ef7a7..135b70633252 100644 --- a/http-client-spi/src/test/java/software/amazon/awssdk/http/TlsKeyManagersProviderTest.java +++ b/http-client-spi/src/test/java/software/amazon/awssdk/http/TlsKeyManagersProviderTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.http; import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class TlsKeyManagersProviderTest { diff --git a/http-client-spi/src/test/java/software/amazon/awssdk/http/software/amazon/awssdk/internal/http/NoneTlsKeyManagersProviderTest.java b/http-client-spi/src/test/java/software/amazon/awssdk/http/software/amazon/awssdk/internal/http/NoneTlsKeyManagersProviderTest.java index 776277e3c56f..566718e2dc64 100644 --- a/http-client-spi/src/test/java/software/amazon/awssdk/http/software/amazon/awssdk/internal/http/NoneTlsKeyManagersProviderTest.java +++ b/http-client-spi/src/test/java/software/amazon/awssdk/http/software/amazon/awssdk/internal/http/NoneTlsKeyManagersProviderTest.java @@ -16,7 +16,8 @@ package software.amazon.awssdk.http.software.amazon.awssdk.internal.http; import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; + +import org.junit.jupiter.api.Test; import software.amazon.awssdk.internal.http.NoneTlsKeyManagersProvider; public class NoneTlsKeyManagersProviderTest { diff --git a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ApacheClientTlsAuthTest.java b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ApacheClientTlsAuthTest.java index f6721255ce2b..be8e81e15232 100644 --- a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ApacheClientTlsAuthTest.java +++ b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ApacheClientTlsAuthTest.java @@ -31,12 +31,12 @@ import java.net.URI; import javax.net.ssl.SSLException; import org.apache.http.NoHttpResponseException; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.BeforeAll; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.http.FileStoreTlsKeyManagersProvider; import software.amazon.awssdk.http.HttpExecuteRequest; @@ -60,7 +60,7 @@ public class ApacheClientTlsAuthTest extends ClientTlsAuthTestBase { @Rule public ExpectedException thrown = ExpectedException.none(); - @BeforeClass + @BeforeAll public static void setUp() throws IOException { ClientTlsAuthTestBase.setUp(); @@ -82,12 +82,12 @@ public static void setUp() throws IOException { keyManagersProvider = FileStoreTlsKeyManagersProvider.create(clientKeyStore, CLIENT_STORE_TYPE, STORE_PASSWORD); } - @Before + @BeforeEach public void methodSetup() { wireMockServer.stubFor(any(urlMatching(".*")).willReturn(aResponse().withStatus(200).withBody("{}"))); } - @AfterClass + @AfterAll public static void teardown() throws IOException { wireMockServer.stop(); System.clearProperty("javax.net.ssl.trustStore"); @@ -96,7 +96,7 @@ public static void teardown() throws IOException { ClientTlsAuthTestBase.teardown(); } - @After + @AfterEach public void methodTeardown() { if (client != null) { client.close(); diff --git a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ApacheHttpClientTest.java b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ApacheHttpClientTest.java index bd5534d8812d..fefa018b653b 100644 --- a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ApacheHttpClientTest.java +++ b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ApacheHttpClientTest.java @@ -24,15 +24,15 @@ import org.apache.http.conn.DnsResolver; import org.apache.http.conn.routing.HttpRoutePlanner; import org.apache.http.impl.conn.SystemDefaultDnsResolver; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; /** * @see ApacheHttpClientWireMockTest */ public class ApacheHttpClientTest { - @After + @AfterEach public void cleanup() { System.clearProperty("http.proxyHost"); System.clearProperty("http.proxyPort"); diff --git a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ClientTlsAuthTestBase.java b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ClientTlsAuthTestBase.java index 8f3bdca14428..0ffd58bb4313 100644 --- a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ClientTlsAuthTestBase.java +++ b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ClientTlsAuthTestBase.java @@ -19,8 +19,8 @@ import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; abstract class ClientTlsAuthTestBase { protected static final String STORE_PASSWORD = "password"; @@ -32,13 +32,13 @@ abstract class ClientTlsAuthTestBase { protected static Path serverKeyStore; protected static Path clientKeyStore; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { tempDir = Files.createTempDirectory(ClientTlsAuthTestBase.class.getSimpleName()); copyCertsToTmpDir(); } - @AfterClass + @AfterAll public static void teardown() throws IOException { Files.deleteIfExists(serverKeyStore); Files.deleteIfExists(clientKeyStore); diff --git a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ProxyConfigurationTest.java b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ProxyConfigurationTest.java index e2bb5dd07241..f740843e8d31 100644 --- a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ProxyConfigurationTest.java +++ b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/ProxyConfigurationTest.java @@ -20,18 +20,18 @@ import java.net.URI; import java.util.HashSet; import java.util.Set; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class ProxyConfigurationTest { - @Before + @BeforeEach public void setup() { clearProxyProperties(); } - @AfterClass + @AfterAll public static void cleanup() { clearProxyProperties(); } diff --git a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/SdkProxyRoutePlannerTest.java b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/SdkProxyRoutePlannerTest.java index 3a81c89dcc1d..822ecf7a5520 100644 --- a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/SdkProxyRoutePlannerTest.java +++ b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/SdkProxyRoutePlannerTest.java @@ -22,7 +22,7 @@ import org.apache.http.HttpHost; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.protocol.HttpClientContext; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link SdkProxyRoutePlanner}. diff --git a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/conn/SdkTlsSocketFactoryTest.java b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/conn/SdkTlsSocketFactoryTest.java index 0ea8584ce7b7..8abd5f488eb9 100644 --- a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/conn/SdkTlsSocketFactoryTest.java +++ b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/conn/SdkTlsSocketFactoryTest.java @@ -26,7 +26,7 @@ import java.util.List; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class SdkTlsSocketFactoryTest { /** diff --git a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/impl/ApacheHttpRequestFactoryTest.java b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/impl/ApacheHttpRequestFactoryTest.java index 5455921e8e81..1048047d6f48 100644 --- a/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/impl/ApacheHttpRequestFactoryTest.java +++ b/http-clients/apache-client/src/test/java/software/amazon/awssdk/http/apache/internal/impl/ApacheHttpRequestFactoryTest.java @@ -25,8 +25,8 @@ import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.Header; import org.apache.http.HttpHeaders; -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.HttpExecuteRequest; import software.amazon.awssdk.http.SdkHttpMethod; import software.amazon.awssdk.http.SdkHttpRequest; @@ -37,7 +37,7 @@ public class ApacheHttpRequestFactoryTest { private ApacheHttpRequestConfig requestConfig; private ApacheHttpRequestFactory instance; - @Before + @BeforeEach public void setup() { instance = new ApacheHttpRequestFactory(); requestConfig = ApacheHttpRequestConfig.builder() diff --git a/http-clients/aws-crt-client/src/it/java/software/amazon/awssdk/http/crt/AwsCrtClientKmsIntegrationTest.java b/http-clients/aws-crt-client/src/it/java/software/amazon/awssdk/http/crt/AwsCrtClientKmsIntegrationTest.java index fc7e36803a87..3bdd4fcf7c62 100644 --- a/http-clients/aws-crt-client/src/it/java/software/amazon/awssdk/http/crt/AwsCrtClientKmsIntegrationTest.java +++ b/http-clients/aws-crt-client/src/it/java/software/amazon/awssdk/http/crt/AwsCrtClientKmsIntegrationTest.java @@ -5,10 +5,10 @@ import java.util.ArrayList; import java.util.List; import java.util.UUID; -import org.junit.After; +import org.junit.jupiter.api.AfterEach; import org.junit.Assert; -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.SdkBytes; import software.amazon.awssdk.crt.CrtResource; import software.amazon.awssdk.crt.io.EventLoopGroup; @@ -37,7 +37,7 @@ public class AwsCrtClientKmsIntegrationTest { private static EventLoopGroup eventLoopGroup; private static HostResolver hostResolver; - @Before + @BeforeEach public void setup() { CrtResource.waitForNoResources(); @@ -59,7 +59,7 @@ public void setup() { } - @After + @AfterEach public void tearDown() { hostResolver.close(); eventLoopGroup.close(); diff --git a/http-clients/aws-crt-client/src/it/java/software/amazon/awssdk/http/crt/AwsCrtClientS3IntegrationTest.java b/http-clients/aws-crt-client/src/it/java/software/amazon/awssdk/http/crt/AwsCrtClientS3IntegrationTest.java index 03862022e26c..8532ec8b628c 100644 --- a/http-clients/aws-crt-client/src/it/java/software/amazon/awssdk/http/crt/AwsCrtClientS3IntegrationTest.java +++ b/http-clients/aws-crt-client/src/it/java/software/amazon/awssdk/http/crt/AwsCrtClientS3IntegrationTest.java @@ -22,10 +22,10 @@ import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.Assert; -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.AnonymousCredentialsProvider; import software.amazon.awssdk.core.ResponseBytes; import software.amazon.awssdk.core.async.AsyncResponseTransformer; @@ -54,7 +54,7 @@ public class AwsCrtClientS3IntegrationTest { private static S3AsyncClient s3; - @BeforeClass + @BeforeAll public static void setup() { CrtResource.waitForNoResources(); @@ -67,7 +67,7 @@ public static void setup() { .build(); } - @AfterClass + @AfterAll public static void tearDown() { s3.close(); crtClient.close(); diff --git a/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/AwsCrtHttpClientSpiVerificationTest.java b/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/AwsCrtHttpClientSpiVerificationTest.java index 4c7feb9a3929..7bc0d1004bf8 100644 --- a/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/AwsCrtHttpClientSpiVerificationTest.java +++ b/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/AwsCrtHttpClientSpiVerificationTest.java @@ -38,10 +38,10 @@ import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicReference; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; @@ -67,7 +67,7 @@ public class AwsCrtHttpClientSpiVerificationTest { private SdkAsyncHttpClient client; - @Before + @BeforeEach public void setup() throws Exception { CrtResource.waitForNoResources(); @@ -77,7 +77,7 @@ public void setup() throws Exception { .build(); } - @After + @AfterEach public void tearDown() { client.close(); EventLoopGroup.closeStaticDefault(); diff --git a/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/AwsCrtHttpClientWireMockTest.java b/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/AwsCrtHttpClientWireMockTest.java index 8758c8212aab..344337dc0373 100644 --- a/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/AwsCrtHttpClientWireMockTest.java +++ b/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/AwsCrtHttpClientWireMockTest.java @@ -28,11 +28,11 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; import java.util.concurrent.TimeUnit; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.crt.CrtResource; import software.amazon.awssdk.crt.io.EventLoopGroup; import software.amazon.awssdk.crt.io.HostResolver; @@ -53,17 +53,17 @@ public class AwsCrtHttpClientWireMockTest { .dynamicHttpsPort() .networkTrafficListener(wiremockTrafficListener)); - @BeforeClass + @BeforeAll public static void setup() { System.setProperty("aws.crt.debugnative", "true"); } - @Before + @BeforeEach public void methodSetup() { wiremockTrafficListener.reset(); } - @After + @AfterEach public void tearDown() { // Verify there is no resource leak. EventLoopGroup.closeStaticDefault(); diff --git a/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ConnectionHealthChecksConfigurationTest.java b/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ConnectionHealthChecksConfigurationTest.java index bc7eef8b9b14..a0b642d844e3 100644 --- a/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ConnectionHealthChecksConfigurationTest.java +++ b/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ConnectionHealthChecksConfigurationTest.java @@ -21,7 +21,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.time.Duration; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ConnectionHealthChecksConfigurationTest { diff --git a/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyConfigurationTest.java b/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyConfigurationTest.java index 7114d2ae1ce6..247c0e2fa96d 100644 --- a/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyConfigurationTest.java +++ b/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyConfigurationTest.java @@ -20,9 +20,9 @@ import java.lang.reflect.Method; import java.util.Random; import java.util.stream.Stream; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * Tests for {@link ProxyConfiguration}. @@ -34,12 +34,12 @@ public class ProxyConfigurationTest { private static final String TEST_USER = "testuser"; private static final String TEST_PASSWORD = "123"; - @Before + @BeforeEach public void setup() { clearProxyProperties(); } - @AfterClass + @AfterAll public static void cleanup() { clearProxyProperties(); } diff --git a/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyWireMockTest.java b/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyWireMockTest.java index 1487344b099e..aafe7f0ba513 100644 --- a/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyWireMockTest.java +++ b/http-clients/aws-crt-client/src/test/java/software/amazon/awssdk/http/crt/ProxyWireMockTest.java @@ -28,9 +28,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; -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 software.amazon.awssdk.crt.CrtResource; import software.amazon.awssdk.crt.io.EventLoopGroup; @@ -60,7 +60,7 @@ public class ProxyWireMockTest { .dynamicHttpsPort()); - @Before + @BeforeEach public void setup() { mockProxy.start(); mockServer.start(); @@ -77,7 +77,7 @@ public void setup() { .build(); } - @After + @AfterEach public void teardown() { mockServer.stop(); mockProxy.stop(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/ClientTlsAuthTestBase.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/ClientTlsAuthTestBase.java index 468aad992e47..d2f1f873a695 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/ClientTlsAuthTestBase.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/ClientTlsAuthTestBase.java @@ -19,8 +19,8 @@ import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; abstract class ClientTlsAuthTestBase { protected static final String STORE_PASSWORD = "password"; @@ -32,13 +32,13 @@ abstract class ClientTlsAuthTestBase { protected static Path serverKeyStore; protected static Path clientKeyStore; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { tempDir = Files.createTempDirectory(ClientTlsAuthTestBase.class.getSimpleName()); copyCertsToTmpDir(); } - @AfterClass + @AfterAll public static void teardown() throws IOException { Files.deleteIfExists(serverKeyStore); Files.deleteIfExists(clientKeyStore); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/Http2ConfigurationTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/Http2ConfigurationTest.java index ec93d1455fb5..fb7a1fcb9f47 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/Http2ConfigurationTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/Http2ConfigurationTest.java @@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; public class Http2ConfigurationTest { diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/Http2MetricsTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/Http2MetricsTest.java index fe79f1e51b34..203545cc6da9 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/Http2MetricsTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/Http2MetricsTest.java @@ -37,9 +37,9 @@ import io.netty.handler.codec.http2.Http2StreamFrame; import io.netty.util.ReferenceCountUtil; import java.net.URI; -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.http.EmptyPublisher; import software.amazon.awssdk.http.Http2Metric; import software.amazon.awssdk.http.HttpMetric; @@ -59,12 +59,12 @@ public class Http2MetricsTest { private static final TestHttp2Server SERVER = new TestHttp2Server(); - @BeforeClass + @BeforeAll public static void setup() throws InterruptedException { SERVER.start(); } - @AfterClass + @AfterAll public static void teardown() throws InterruptedException { SERVER.stop(); } diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyClientTlsAuthTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyClientTlsAuthTest.java index 8f1e486d3a07..4c614568ebbe 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyClientTlsAuthTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyClientTlsAuthTest.java @@ -26,11 +26,11 @@ import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; import java.io.IOException; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.http.EmptyPublisher; import software.amazon.awssdk.http.FileStoreTlsKeyManagersProvider; @@ -60,7 +60,7 @@ public class NettyClientTlsAuthTest extends ClientTlsAuthTestBase { private SdkAsyncHttpClient netty; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { ClientTlsAuthTestBase.setUp(); @@ -89,7 +89,7 @@ public static void setUp() throws IOException { keyManagersProvider = FileStoreTlsKeyManagersProvider.create(clientKeyStore, CLIENT_STORE_TYPE, STORE_PASSWORD); } - @AfterClass + @AfterAll public static void teardown() throws IOException { ClientTlsAuthTestBase.teardown(); @@ -100,7 +100,7 @@ public static void teardown() throws IOException { System.clearProperty("javax.net.ssl.trustStoreType"); } - @After + @AfterEach public void methodTeardown() { if (netty != null) { netty.close(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClientDefaultWireMockTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClientDefaultWireMockTest.java index 559edc8f2af6..8e048410be61 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClientDefaultWireMockTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClientDefaultWireMockTest.java @@ -48,20 +48,18 @@ import java.util.concurrent.TimeoutException; import java.util.stream.Stream; import org.assertj.core.api.Condition; -import org.junit.AfterClass; -import org.junit.Before; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; -import software.amazon.awssdk.http.SdkHttpConfigurationOption; import software.amazon.awssdk.http.SdkHttpFullRequest; import software.amazon.awssdk.http.SdkHttpMethod; import software.amazon.awssdk.http.SdkHttpRequest; import software.amazon.awssdk.http.async.AsyncExecuteRequest; import software.amazon.awssdk.http.async.SdkAsyncHttpClient; import software.amazon.awssdk.http.async.SdkHttpContentPublisher; -import software.amazon.awssdk.utils.AttributeMap; public class NettyNioAsyncHttpClientDefaultWireMockTest { @@ -75,12 +73,12 @@ public class NettyNioAsyncHttpClientDefaultWireMockTest { private static SdkAsyncHttpClient client = NettyNioAsyncHttpClient.create(); - @Before + @BeforeEach public void methodSetup() { wiremockTrafficListener.reset(); } - @AfterClass + @AfterAll public static void tearDown() throws Exception { client.close(); } diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClientSpiVerificationTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClientSpiVerificationTest.java index a4e4047fde13..240912713164 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClientSpiVerificationTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClientSpiVerificationTest.java @@ -35,9 +35,9 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; @@ -63,7 +63,7 @@ public class NettyNioAsyncHttpClientSpiVerificationTest { private static SdkAsyncHttpClient client = NettyNioAsyncHttpClient.builder().buildWithDefaults(mapWithTrustAllCerts()); - @AfterClass + @AfterAll public static void tearDown() throws Exception { client.close(); } diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/ProxyConfigurationTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/ProxyConfigurationTest.java index 068e9d88c865..e9700555b7fc 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/ProxyConfigurationTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/ProxyConfigurationTest.java @@ -23,9 +23,9 @@ import java.util.Random; import java.util.Set; import java.util.stream.Stream; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * Tests for {@link ProxyConfiguration}. @@ -38,12 +38,12 @@ public class ProxyConfigurationTest { private static final String TEST_USER = "testuser"; private static final String TEST_PASSWORD = "123"; - @Before + @BeforeEach public void setup() { clearProxyProperties(); } - @AfterClass + @AfterAll public static void cleanup() { clearProxyProperties(); } diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/GoAwayTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/GoAwayTest.java index 957dcaa7fc71..f2e6ae2261ea 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/GoAwayTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/GoAwayTest.java @@ -55,8 +55,8 @@ import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import software.amazon.awssdk.http.Protocol; import software.amazon.awssdk.http.SdkHttpFullRequest; @@ -78,7 +78,7 @@ public class GoAwayTest { private SdkAsyncHttpClient netty; private SimpleEndpointDriver endpointDriver; - @After + @AfterEach public void teardown() throws InterruptedException { if (endpointDriver != null) { endpointDriver.shutdown(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/H2ServerErrorTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/H2ServerErrorTest.java index c4aed9966c19..47c96b32ff16 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/H2ServerErrorTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/H2ServerErrorTest.java @@ -45,9 +45,9 @@ import io.netty.handler.ssl.util.SelfSignedCertificate; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; -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 software.amazon.awssdk.http.Protocol; import software.amazon.awssdk.http.async.SdkAsyncHttpClient; import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient; @@ -63,7 +63,7 @@ public class H2ServerErrorTest { private SdkAsyncHttpClient netty; private Server server; - @Before + @BeforeEach public void setup() throws Exception { server = new Server(); server.init(); @@ -74,7 +74,7 @@ public void setup() throws Exception { .buildWithDefaults(AttributeMap.builder().put(TRUST_ALL_CERTIFICATES, true).build()); } - @After + @AfterEach public void teardown() throws InterruptedException { if (server != null) { server.shutdown(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/PingTimeoutTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/PingTimeoutTest.java index f88c5af2bfcd..019053ec8591 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/PingTimeoutTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/PingTimeoutTest.java @@ -52,10 +52,10 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import org.reactivestreams.Publisher; import org.reactivestreams.Subscriber; @@ -82,13 +82,13 @@ public class PingTimeoutTest { private Server server; private SdkAsyncHttpClient netty; - @Before + @BeforeEach public void methodSetup() throws Exception { server = new Server(); server.init(); } - @After + @AfterEach public void methodTeardown() throws InterruptedException { server.shutdown(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/ServerCloseConnectionTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/ServerCloseConnectionTest.java index cc6fbda166b5..2138746cbcac 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/ServerCloseConnectionTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/ServerCloseConnectionTest.java @@ -52,9 +52,9 @@ import java.time.Duration; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; -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.Publisher; import software.amazon.awssdk.http.Protocol; import software.amazon.awssdk.http.SdkHttpFullRequest; @@ -78,7 +78,7 @@ public class ServerCloseConnectionTest { private SdkAsyncHttpClient netty; private Server server; - @Before + @BeforeEach public void setup() throws Exception { server = new Server(); server.init(); @@ -90,7 +90,7 @@ public void setup() throws Exception { .buildWithDefaults(AttributeMap.builder().put(TRUST_ALL_CERTIFICATES, true).build()); } - @After + @AfterEach public void teardown() throws InterruptedException { if (server != null) { server.shutdown(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/ServerNotRespondingTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/ServerNotRespondingTest.java index 88eb36716106..f4732725e60e 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/ServerNotRespondingTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/fault/ServerNotRespondingTest.java @@ -54,9 +54,9 @@ import java.time.Duration; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; -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.Publisher; import software.amazon.awssdk.http.Protocol; import software.amazon.awssdk.http.SdkHttpFullRequest; @@ -80,7 +80,7 @@ public class ServerNotRespondingTest { private SdkAsyncHttpClient netty; private Server server; - @Before + @BeforeEach public void setup() throws Exception { server = new Server(); server.init(); @@ -93,7 +93,7 @@ public void setup() throws Exception { .buildWithDefaults(AttributeMap.builder().put(TRUST_ALL_CERTIFICATES, true).build()); } - @After + @AfterEach public void teardown() throws InterruptedException { if (server != null) { server.shutdown(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/AwaitCloseChannelPoolMapTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/AwaitCloseChannelPoolMapTest.java index 3b72f71be4db..6283abe65898 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/AwaitCloseChannelPoolMapTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/AwaitCloseChannelPoolMapTest.java @@ -38,9 +38,9 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import org.apache.commons.lang3.RandomStringUtils; -import org.junit.After; +import org.junit.jupiter.api.AfterEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import software.amazon.awssdk.http.Protocol; import software.amazon.awssdk.http.TlsKeyManagersProvider; @@ -60,7 +60,7 @@ public class AwaitCloseChannelPoolMapTest { .dynamicPort() .networkTrafficListener(recorder)); - @After + @AfterEach public void methodTeardown() { if (channelPoolMap != null) { channelPoolMap.close(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/ChannelPipelineInitializerTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/ChannelPipelineInitializerTest.java index 12e0627bb1e4..f8d2fae60109 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/ChannelPipelineInitializerTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/ChannelPipelineInitializerTest.java @@ -33,7 +33,7 @@ import java.time.Duration; import java.util.concurrent.atomic.AtomicReference; import javax.net.ssl.SSLException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.http.Protocol; public class ChannelPipelineInitializerTest { diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/HealthCheckedChannelPoolTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/HealthCheckedChannelPoolTest.java index e610884e3eff..724d59b571a5 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/HealthCheckedChannelPoolTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/HealthCheckedChannelPoolTest.java @@ -41,8 +41,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.mockito.stubbing.Answer; @@ -66,7 +66,7 @@ public class HealthCheckedChannelPoolTest { NETTY_CONFIGURATION, downstreamChannelPool); - @Before + @BeforeEach public void reset() { Mockito.reset(eventLoopGroup, eventLoop, downstreamChannelPool, scheduledFuture, attribute); channels.clear(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/HonorCloseOnReleaseChannelPoolTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/HonorCloseOnReleaseChannelPoolTest.java index 58941ef0c6b8..de5b4288e62a 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/HonorCloseOnReleaseChannelPoolTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/HonorCloseOnReleaseChannelPoolTest.java @@ -25,7 +25,7 @@ import io.netty.util.concurrent.Future; import io.netty.util.concurrent.Promise; import java.util.concurrent.TimeUnit; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.mockito.internal.verification.Times; diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/LastHttpContentHandlerTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/LastHttpContentHandlerTest.java index 33263a5911d8..e8f368e699cf 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/LastHttpContentHandlerTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/LastHttpContentHandlerTest.java @@ -20,9 +20,9 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.LastHttpContent; -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.mockito.Mockito; @@ -32,7 +32,7 @@ public class LastHttpContentHandlerTest { private ChannelHandlerContext handlerContext; private LastHttpContentHandler contentHandler = LastHttpContentHandler.create(); - @Before + @BeforeEach public void setup() throws Exception { channel = new MockChannel(); channel.attr(LAST_HTTP_CONTENT_RECEIVED_KEY).set(false); @@ -40,7 +40,7 @@ public void setup() throws Exception { Mockito.when(handlerContext.channel()).thenReturn(channel); } - @After + @AfterEach public void cleanup() { channel.close(); } diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/LastHttpContentSwallowerTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/LastHttpContentSwallowerTest.java index 75e90ef19f11..9f40aa646290 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/LastHttpContentSwallowerTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/LastHttpContentSwallowerTest.java @@ -26,8 +26,8 @@ import io.netty.handler.codec.http.HttpContent; import io.netty.handler.codec.http.HttpObject; import io.netty.handler.codec.http.LastHttpContent; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * Tests for {@link LastHttpContentSwallower}. @@ -37,7 +37,7 @@ public class LastHttpContentSwallowerTest { private ChannelHandlerContext mockCtx; private ChannelPipeline mockPipeline; - @Before + @BeforeEach public void setUp() { mockCtx = mock(ChannelHandlerContext.class); mockPipeline = mock(ChannelPipeline.class); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/NettyRequestExecutorTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/NettyRequestExecutorTest.java index ed7260d9a318..3e03ae5544dc 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/NettyRequestExecutorTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/NettyRequestExecutorTest.java @@ -39,9 +39,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -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.mockito.ArgumentCaptor; import org.mockito.stubbing.Answer; import software.amazon.awssdk.http.Protocol; @@ -60,7 +60,7 @@ public class NettyRequestExecutorTest { private RequestContext requestContext; - @Before + @BeforeEach public void setup() { mockChannelPool = mock(SdkChannelPool.class); @@ -82,7 +82,7 @@ public void setup() { nettyRequestExecutor = new NettyRequestExecutor(requestContext); } - @After + @AfterEach public void teardown() throws InterruptedException { eventLoopGroup.shutdownGracefully().await(); } diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/OldConnectionReaperHandlerTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/OldConnectionReaperHandlerTest.java index e5e3f6f57210..1be84615840d 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/OldConnectionReaperHandlerTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/OldConnectionReaperHandlerTest.java @@ -19,7 +19,7 @@ import static org.mockito.Matchers.any; import io.netty.channel.ChannelHandlerContext; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.mockito.internal.verification.Times; diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/RequestAdapterTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/RequestAdapterTest.java index 31e2aca3c9e7..01baa69274d0 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/RequestAdapterTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/RequestAdapterTest.java @@ -26,7 +26,7 @@ import io.netty.handler.codec.http2.HttpConversionUtil; import java.net.URI; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.http.Protocol; import software.amazon.awssdk.http.SdkHttpMethod; import software.amazon.awssdk.http.SdkHttpRequest; diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/ResponseCompletionTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/ResponseCompletionTest.java index 56601cf8bdb3..16e6ba3f56d9 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/ResponseCompletionTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/ResponseCompletionTest.java @@ -50,8 +50,8 @@ import java.util.List; import java.util.concurrent.CompletableFuture; import org.apache.commons.lang3.RandomStringUtils; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import software.amazon.awssdk.http.Protocol; import software.amazon.awssdk.http.SdkHttpFullRequest; @@ -70,7 +70,7 @@ public class ResponseCompletionTest { private SdkAsyncHttpClient netty; private Server server; - @After + @AfterEach public void teardown() throws InterruptedException { if (server != null) { server.shutdown(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SdkChannelOptionsTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SdkChannelOptionsTest.java index 49fbf116b674..f917d038ed9a 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SdkChannelOptionsTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SdkChannelOptionsTest.java @@ -20,7 +20,7 @@ import io.netty.channel.ChannelOption; import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class SdkChannelOptionsTest { diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SharedSdkEventLoopGroupTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SharedSdkEventLoopGroupTest.java index 755630f1ee31..25578820abf9 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SharedSdkEventLoopGroupTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SharedSdkEventLoopGroupTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Java6Assertions.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.http.nio.netty.SdkEventLoopGroup; public class SharedSdkEventLoopGroupTest { diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SslCloseCompletionEventHandlerTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SslCloseCompletionEventHandlerTest.java index 1e1dcea1c6a9..b0235f4e3d99 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SslCloseCompletionEventHandlerTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SslCloseCompletionEventHandlerTest.java @@ -23,23 +23,23 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.handler.ssl.SslCloseCompletionEvent; import java.nio.channels.ClosedChannelException; -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; public class SslCloseCompletionEventHandlerTest { private ChannelHandlerContext ctx; private MockChannel channel; - @Before + @BeforeEach public void setup() throws Exception { ctx = mock(ChannelHandlerContext.class); channel = new MockChannel(); when(ctx.channel()).thenReturn(channel); } - @After + @AfterEach public void teardown() { channel.close(); } diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SslContextProviderTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SslContextProviderTest.java index 6f8954261fd7..ee279eabdb07 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SslContextProviderTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/SslContextProviderTest.java @@ -24,7 +24,7 @@ import io.netty.handler.codec.http2.Http2SecurityUtil; import io.netty.handler.ssl.SslProvider; import javax.net.ssl.TrustManager; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import software.amazon.awssdk.http.Protocol; import software.amazon.awssdk.http.SdkHttpConfigurationOption; diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/StaticKeyManagerFactoryTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/StaticKeyManagerFactoryTest.java index 4e79ad583d5e..dce508ea0ea1 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/StaticKeyManagerFactoryTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/StaticKeyManagerFactoryTest.java @@ -19,7 +19,7 @@ import static org.mockito.Mockito.mock; import java.util.stream.IntStream; import javax.net.ssl.KeyManager; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Tests for {@link StaticKeyManagerFactory}. diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/Http2GoAwayEventListenerTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/Http2GoAwayEventListenerTest.java index 67f8c28df2cf..25b3312bc6fd 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/Http2GoAwayEventListenerTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/Http2GoAwayEventListenerTest.java @@ -28,10 +28,9 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPipeline; -import io.netty.handler.codec.http2.DefaultHttp2GoAwayFrame; import io.netty.util.Attribute; -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.nio.netty.internal.ChannelAttributeKey; public class Http2GoAwayEventListenerTest { @@ -40,7 +39,7 @@ public class Http2GoAwayEventListenerTest { private ChannelPipeline channelPipeline; private Attribute attribute; - @Before + @BeforeEach public void setup() { this.ctx = mock(ChannelHandlerContext.class); this.channel = mock(Channel.class); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/Http2PingHandlerTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/Http2PingHandlerTest.java index 2788337dacba..437e342b7ad4 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/Http2PingHandlerTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/Http2PingHandlerTest.java @@ -34,8 +34,8 @@ import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; -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.http.Protocol; import software.amazon.awssdk.http.nio.netty.internal.ChannelAttributeKey; @@ -46,7 +46,7 @@ public class Http2PingHandlerTest { private Http2PingHandler fastChecker; private Http2PingHandler slowChecker; - @Before + @BeforeEach public void setup() throws Exception { this.fastChecker = new Http2PingHandler(FAST_CHECKER_DURATION_MILLIS); this.slowChecker = new Http2PingHandler(30 * 1_000); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/MultiplexedChannelRecordTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/MultiplexedChannelRecordTest.java index 28a54eefc024..5e248f9e76d3 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/MultiplexedChannelRecordTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/MultiplexedChannelRecordTest.java @@ -33,9 +33,9 @@ import java.time.Duration; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -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 software.amazon.awssdk.http.Protocol; import software.amazon.awssdk.http.nio.netty.internal.ChannelAttributeKey; import software.amazon.awssdk.http.nio.netty.internal.MockChannel; @@ -45,13 +45,13 @@ public class MultiplexedChannelRecordTest { private EventLoopGroup loopGroup; private MockChannel channel; - @Before + @BeforeEach public void setup() throws Exception { loopGroup = new NioEventLoopGroup(4); channel = new MockChannel(); } - @After + @AfterEach public void teardown() { loopGroup.shutdownGracefully().awaitUninterruptibly(); channel.close(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/ReadTimeoutTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/ReadTimeoutTest.java index f1d66aa9f726..79ac42d587cc 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/ReadTimeoutTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/ReadTimeoutTest.java @@ -40,8 +40,8 @@ import java.time.Duration; import java.util.Optional; import java.util.function.Supplier; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import org.reactivestreams.Subscriber; import software.amazon.awssdk.http.Protocol; @@ -59,7 +59,7 @@ public class ReadTimeoutTest { private TestH2Server testServer; private SdkAsyncHttpClient netty; - @After + @AfterEach public void methodTeardown() throws InterruptedException { if (testServer != null) { testServer.shutdown(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/WindowSizeTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/WindowSizeTest.java index e33ddfcb6e17..8ee94a9ac405 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/WindowSizeTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/http2/WindowSizeTest.java @@ -42,9 +42,9 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.function.Supplier; import java.util.stream.Collectors; -import org.junit.After; +import org.junit.jupiter.api.AfterEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import org.reactivestreams.Publisher; import software.amazon.awssdk.http.Protocol; @@ -67,7 +67,7 @@ public class WindowSizeTest { @Rule public ExpectedException expected = ExpectedException.none(); - @After + @AfterEach public void methodTeardown() throws InterruptedException { if (netty != null) { netty.close(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/nrs/ChannelPublisherTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/nrs/ChannelPublisherTest.java index 7f8755545108..b68329cbb7e4 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/nrs/ChannelPublisherTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/nrs/ChannelPublisherTest.java @@ -39,9 +39,9 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -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.Publisher; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; @@ -61,7 +61,7 @@ public class ChannelPublisherTest { private Publisher publisher; private SubscriberProbe subscriber; - @Before + @BeforeEach public void start() throws Exception { group = new NioEventLoopGroup(); EventLoop eventLoop = group.next(); @@ -82,7 +82,7 @@ public void start() throws Exception { subscriber = new SubscriberProbe<>(); } - @After + @AfterEach public void stop() throws Exception { channel.unsafe().closeForcibly(); group.shutdownGracefully(); diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/nrs/HandlerSubscriberTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/nrs/HandlerSubscriberTest.java index 4b47365fce1f..8ec96828e153 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/nrs/HandlerSubscriberTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/nrs/HandlerSubscriberTest.java @@ -36,9 +36,9 @@ import java.util.ArrayDeque; import java.util.Queue; import java.util.concurrent.TimeUnit; -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.Subscription; /** @@ -54,7 +54,7 @@ public class HandlerSubscriberTest { private CustomEmbeddedEventLoop eventLoop; private HandlerSubscriber handler; - @Before + @BeforeEach public void setup() throws Exception { channel = new CustomEmbeddedChannel(); eventLoop = new CustomEmbeddedEventLoop(); @@ -64,7 +64,7 @@ public void setup() throws Exception { channel.pipeline().addLast(handler); } - @After + @AfterEach public void teardown() { channel.close(); } diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/ChannelUtilsTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/ChannelUtilsTest.java index 1bf5c0e509a5..1087ce62778a 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/ChannelUtilsTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/ChannelUtilsTest.java @@ -25,7 +25,7 @@ import io.netty.handler.logging.LoggingHandler; import io.netty.handler.timeout.ReadTimeoutHandler; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.http.nio.netty.internal.MockChannel; public class ChannelUtilsTest { diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/NettyUtilsTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/NettyUtilsTest.java index 3b27dd1c78e8..a58a032d750b 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/NettyUtilsTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/NettyUtilsTest.java @@ -30,7 +30,7 @@ import io.netty.util.concurrent.EventExecutor; import java.time.Duration; import javax.net.ssl.SSLEngine; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.http.nio.netty.internal.MockChannel; public class NettyUtilsTest { diff --git a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/SocketChannelResolverTest.java b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/SocketChannelResolverTest.java index 2dbfefa4e46d..89a79c936356 100644 --- a/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/SocketChannelResolverTest.java +++ b/http-clients/netty-nio-client/src/test/java/software/amazon/awssdk/http/nio/netty/internal/utils/SocketChannelResolverTest.java @@ -26,7 +26,7 @@ import io.netty.channel.oio.OioEventLoopGroup; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.channel.socket.oio.OioSocketChannel; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.http.nio.netty.internal.DelegatingEventLoopGroup; public class SocketChannelResolverTest { diff --git a/http-clients/url-connection-client/src/it/java/software/amazon/awssdk/http/urlconnection/S3WithUrlHttpClientIntegrationTest.java b/http-clients/url-connection-client/src/it/java/software/amazon/awssdk/http/urlconnection/S3WithUrlHttpClientIntegrationTest.java index 88f8081eec4d..405f9d3b5325 100644 --- a/http-clients/url-connection-client/src/it/java/software/amazon/awssdk/http/urlconnection/S3WithUrlHttpClientIntegrationTest.java +++ b/http-clients/url-connection-client/src/it/java/software/amazon/awssdk/http/urlconnection/S3WithUrlHttpClientIntegrationTest.java @@ -24,11 +24,10 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; -import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.core.interceptor.ExecutionInterceptor; @@ -38,7 +37,6 @@ import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.S3Client; import software.amazon.awssdk.services.s3.S3ClientBuilder; -import software.amazon.awssdk.services.s3.S3Configuration; import software.amazon.awssdk.services.s3.model.CreateBucketConfiguration; import software.amazon.awssdk.services.s3.model.CreateBucketRequest; import software.amazon.awssdk.services.s3.model.DeleteBucketRequest; @@ -64,7 +62,7 @@ public class S3WithUrlHttpClientIntegrationTest { /** * Creates all the test resources for the tests. */ - @BeforeClass + @BeforeAll public static void createResources() throws Exception { S3ClientBuilder s3ClientBuilder = S3Client.builder() .region(REGION) @@ -82,13 +80,13 @@ public static void createResources() throws Exception { /** * Releases all resources created in this test. */ - @AfterClass + @AfterAll public static void tearDown() { deleteObject(BUCKET_NAME, KEY); deleteBucket(BUCKET_NAME); } - @Before + @BeforeEach public void methodSetup() { capturingInterceptor.reset(); } diff --git a/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientDefaultWireMockTest.java b/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientDefaultWireMockTest.java index 3dc3035d4274..66cbc4e3b814 100644 --- a/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientDefaultWireMockTest.java +++ b/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientDefaultWireMockTest.java @@ -17,7 +17,7 @@ import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; -import org.junit.After; +import org.junit.jupiter.api.AfterEach; import software.amazon.awssdk.http.SdkHttpClient; import software.amazon.awssdk.http.SdkHttpClientDefaultTestSuite; @@ -28,7 +28,7 @@ protected SdkHttpClient createSdkHttpClient() { return UrlConnectionHttpClient.create(); } - @After + @AfterEach public void reset() { HttpsURLConnection.setDefaultSSLSocketFactory((SSLSocketFactory) SSLSocketFactory.getDefault()); } diff --git a/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientWireMockTest.java b/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientWireMockTest.java index 24588be760d1..939484a8d0de 100644 --- a/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientWireMockTest.java +++ b/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientWireMockTest.java @@ -18,7 +18,7 @@ import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSocketFactory; -import org.junit.After; +import org.junit.jupiter.api.AfterEach; import software.amazon.awssdk.http.SdkHttpClient; import software.amazon.awssdk.http.SdkHttpClientTestSuite; import software.amazon.awssdk.utils.AttributeMap; @@ -41,7 +41,7 @@ protected SdkHttpClient createSdkHttpClient(SdkHttpClientOptions options) { return builder.buildWithDefaults(attributeMap.build()); } - @After + @AfterEach public void reset() { HttpsURLConnection.setDefaultSSLSocketFactory((SSLSocketFactory) SSLSocketFactory.getDefault()); } diff --git a/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientWithCustomCreateWireMockTest.java b/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientWithCustomCreateWireMockTest.java index e64392dee52f..7c9601cdb6a1 100644 --- a/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientWithCustomCreateWireMockTest.java +++ b/http-clients/url-connection-client/src/test/java/software/amazon/awssdk/http/urlconnection/UrlConnectionHttpClientWithCustomCreateWireMockTest.java @@ -23,8 +23,8 @@ import java.io.IOException; import java.net.HttpURLConnection; import java.util.function.Function; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.http.SdkHttpClient; import software.amazon.awssdk.http.SdkHttpClientTestSuite; @@ -40,17 +40,17 @@ protected SdkHttpClient createSdkHttpClient(SdkHttpClientOptions options) { })); } - @Ignore // Not supported when using custom factory + @Disabled // Not supported when using custom factory @Override public void testCustomTlsTrustManager() { } - @Ignore // Not supported when using custom factory + @Disabled // Not supported when using custom factory @Override public void testTrustAllWorks() { } - @Ignore // Not supported when using custom factory + @Disabled // Not supported when using custom factory @Override public void testCustomTlsTrustManagerAndTrustAllFails() { } diff --git a/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/MetricUploaderTest.java b/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/MetricUploaderTest.java index daaec59916c9..df3198860d42 100644 --- a/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/MetricUploaderTest.java +++ b/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/MetricUploaderTest.java @@ -24,8 +24,8 @@ import java.util.Arrays; import java.util.List; import java.util.concurrent.CompletableFuture; -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.services.cloudwatch.CloudWatchAsyncClient; import software.amazon.awssdk.services.cloudwatch.model.PutMetricDataRequest; @@ -38,7 +38,7 @@ public class MetricUploaderTest { private MetricUploader uploader; - @Before + @BeforeEach public void setUp() { client = Mockito.mock(CloudWatchAsyncClient.class); uploader = new MetricUploader(client); diff --git a/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/task/UploadMetricsTasksTest.java b/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/task/UploadMetricsTasksTest.java index 619802355503..eb4d5825d057 100644 --- a/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/task/UploadMetricsTasksTest.java +++ b/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/task/UploadMetricsTasksTest.java @@ -19,8 +19,8 @@ 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 org.mockito.ArgumentCaptor; import org.mockito.Mockito; import software.amazon.awssdk.metrics.publishers.cloudwatch.internal.MetricUploader; @@ -32,7 +32,7 @@ public class UploadMetricsTasksTest { private MetricUploader uploader; private UploadMetricsTasks task; - @Before + @BeforeEach public void setUp() { aggregator = Mockito.mock(MetricCollectionAggregator.class); uploader = Mockito.mock(MetricUploader.class); diff --git a/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/transform/MetricCollectionAggregatorTest.java b/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/transform/MetricCollectionAggregatorTest.java index e2d537853811..7e9fb2b412c0 100644 --- a/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/transform/MetricCollectionAggregatorTest.java +++ b/metric-publishers/cloudwatch-metric-publisher/src/test/java/software/amazon/awssdk/metrics/publishers/cloudwatch/internal/transform/MetricCollectionAggregatorTest.java @@ -27,7 +27,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.metrics.CoreMetric; import software.amazon.awssdk.http.HttpMetric; import software.amazon.awssdk.metrics.MetricCategory; diff --git a/pom.xml b/pom.xml index 0f7339893fb0..a8281b4cf32d 100644 --- a/pom.xml +++ b/pom.xml @@ -419,11 +419,11 @@ junit:*:* + org.junit.* software.amazon.awssdk:test-utils org.hamcrest:* org.testng:testng org.mockito:* - org.junit.platform:* org.opentest4j:* @@ -434,8 +434,7 @@ com.typesafe.netty:* - org.junit.jupiter:* - org.junit.vintage:* + org.junit.* software.amazon.awssdk:aws-sdk-java org.codehaus.plexus:plexus-utils diff --git a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncDeleteItemWithResponseIntegrationTest.java b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncDeleteItemWithResponseIntegrationTest.java index 88687e6ac725..e51c3bba8b8c 100644 --- a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncDeleteItemWithResponseIntegrationTest.java +++ b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncDeleteItemWithResponseIntegrationTest.java @@ -22,9 +22,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.secondarySortKey; import java.util.Objects; -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.enhanced.dynamodb.mapper.StaticTableSchema; import software.amazon.awssdk.enhanced.dynamodb.model.DeleteItemEnhancedResponse; import software.amazon.awssdk.enhanced.dynamodb.model.EnhancedLocalSecondaryIndex; @@ -116,7 +116,7 @@ public int hashCode() { private static DynamoDbEnhancedAsyncClient enhancedClient; private static DynamoDbAsyncTable mappedTable; - @BeforeClass + @BeforeAll public static void setup() { dynamoDbClient = createAsyncDynamoDbClient(); enhancedClient = DynamoDbEnhancedAsyncClient.builder().dynamoDbClient(dynamoDbClient).build(); @@ -125,7 +125,7 @@ public static void setup() { dynamoDbClient.waiter().waitUntilTableExists(r -> r.tableName(TABLE_NAME)).join(); } - @AfterClass + @AfterAll public static void teardown() { try { dynamoDbClient.deleteTable(r -> r.tableName(TABLE_NAME)); diff --git a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncPutItemWithResponseIntegrationTest.java b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncPutItemWithResponseIntegrationTest.java index f423309b3e72..43de8cfc0075 100644 --- a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncPutItemWithResponseIntegrationTest.java +++ b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncPutItemWithResponseIntegrationTest.java @@ -22,9 +22,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.secondarySortKey; import java.util.Objects; -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.enhanced.dynamodb.mapper.StaticTableSchema; import software.amazon.awssdk.enhanced.dynamodb.model.EnhancedLocalSecondaryIndex; import software.amazon.awssdk.enhanced.dynamodb.model.PutItemEnhancedRequest; @@ -119,7 +119,7 @@ public int hashCode() { private static DynamoDbAsyncTable mappedTable; - @BeforeClass + @BeforeAll public static void setup() { dynamoDbClient = createDynamoDbClient(); asyncDynamoDbClient = createAsyncDynamoDbClient(); @@ -131,7 +131,7 @@ public static void setup() { dynamoDbClient.waiter().waitUntilTableExists(r -> r.tableName(TABLE_NAME)); } - @AfterClass + @AfterAll public static void teardown() { try { dynamoDbClient.deleteTable(r -> r.tableName(TABLE_NAME)); diff --git a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncUpdateItemWithResponseIntegrationTest.java b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncUpdateItemWithResponseIntegrationTest.java index 28183923f546..ba1a110f55f5 100644 --- a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncUpdateItemWithResponseIntegrationTest.java +++ b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/AsyncUpdateItemWithResponseIntegrationTest.java @@ -22,9 +22,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.secondarySortKey; import java.util.Objects; -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.enhanced.dynamodb.mapper.StaticTableSchema; import software.amazon.awssdk.enhanced.dynamodb.model.EnhancedLocalSecondaryIndex; import software.amazon.awssdk.enhanced.dynamodb.model.UpdateItemEnhancedRequest; @@ -116,7 +116,7 @@ public int hashCode() { private static DynamoDbEnhancedAsyncClient enhancedClient; private static DynamoDbAsyncTable mappedTable; - @BeforeClass + @BeforeAll public static void setup() { dynamoDbClient = createAsyncDynamoDbClient(); enhancedClient = DynamoDbEnhancedAsyncClient.builder().dynamoDbClient(dynamoDbClient).build(); @@ -125,7 +125,7 @@ public static void setup() { dynamoDbClient.waiter().waitUntilTableExists(r -> r.tableName(TABLE_NAME)).join(); } - @AfterClass + @AfterAll public static void teardown() { try { dynamoDbClient.deleteTable(r -> r.tableName(TABLE_NAME)).join(); diff --git a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/DeleteItemWithResponseIntegrationTest.java b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/DeleteItemWithResponseIntegrationTest.java index 7c8c2612e477..54257b70bcb3 100644 --- a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/DeleteItemWithResponseIntegrationTest.java +++ b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/DeleteItemWithResponseIntegrationTest.java @@ -22,9 +22,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.secondarySortKey; import java.util.Objects; -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.enhanced.dynamodb.mapper.StaticTableSchema; import software.amazon.awssdk.enhanced.dynamodb.model.DeleteItemEnhancedResponse; import software.amazon.awssdk.enhanced.dynamodb.model.EnhancedLocalSecondaryIndex; @@ -116,7 +116,7 @@ public int hashCode() { private static DynamoDbEnhancedClient enhancedClient; private static DynamoDbTable mappedTable; - @BeforeClass + @BeforeAll public static void setup() { dynamoDbClient = createDynamoDbClient(); enhancedClient = DynamoDbEnhancedClient.builder().dynamoDbClient(dynamoDbClient).build(); @@ -125,7 +125,7 @@ public static void setup() { dynamoDbClient.waiter().waitUntilTableExists(r -> r.tableName(TABLE_NAME)); } - @AfterClass + @AfterAll public static void teardown() { try { dynamoDbClient.deleteTable(r -> r.tableName(TABLE_NAME)); diff --git a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/PutItemWithResponseIntegrationTest.java b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/PutItemWithResponseIntegrationTest.java index 24f67a92d78e..57159337568b 100644 --- a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/PutItemWithResponseIntegrationTest.java +++ b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/PutItemWithResponseIntegrationTest.java @@ -22,9 +22,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.secondarySortKey; import java.util.Objects; -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.enhanced.dynamodb.mapper.StaticTableSchema; import software.amazon.awssdk.enhanced.dynamodb.model.EnhancedLocalSecondaryIndex; import software.amazon.awssdk.enhanced.dynamodb.model.PutItemEnhancedRequest; @@ -116,7 +116,7 @@ public int hashCode() { private static DynamoDbEnhancedClient enhancedClient; private static DynamoDbTable mappedTable; - @BeforeClass + @BeforeAll public static void setup() { dynamoDbClient = createDynamoDbClient(); enhancedClient = DynamoDbEnhancedClient.builder().dynamoDbClient(dynamoDbClient).build(); @@ -125,7 +125,7 @@ public static void setup() { dynamoDbClient.waiter().waitUntilTableExists(r -> r.tableName(TABLE_NAME)); } - @AfterClass + @AfterAll public static void teardown() { try { dynamoDbClient.deleteTable(r -> r.tableName(TABLE_NAME)); diff --git a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/UpdateItemWithResponseIntegrationTest.java b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/UpdateItemWithResponseIntegrationTest.java index c8767edaf216..d6483889849d 100644 --- a/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/UpdateItemWithResponseIntegrationTest.java +++ b/services-custom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/UpdateItemWithResponseIntegrationTest.java @@ -22,9 +22,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.secondarySortKey; import java.util.Objects; -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.enhanced.dynamodb.mapper.StaticTableSchema; import software.amazon.awssdk.enhanced.dynamodb.model.EnhancedLocalSecondaryIndex; import software.amazon.awssdk.enhanced.dynamodb.model.UpdateItemEnhancedRequest; @@ -116,7 +116,7 @@ public int hashCode() { private static DynamoDbEnhancedClient enhancedClient; private static DynamoDbTable mappedTable; - @BeforeClass + @BeforeAll public static void setup() { dynamoDbClient = createDynamoDbClient(); enhancedClient = DynamoDbEnhancedClient.builder().dynamoDbClient(dynamoDbClient).build(); @@ -125,7 +125,7 @@ public static void setup() { dynamoDbClient.waiter().waitUntilTableExists(r -> r.tableName(TABLE_NAME)); } - @AfterClass + @AfterAll public static void teardown() { try { dynamoDbClient.deleteTable(r -> r.tableName(TABLE_NAME)); diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/EnhancedTypeDocumentationConfigurationTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/EnhancedTypeDocumentationConfigurationTest.java index 5111d8792d62..f5ab69193132 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/EnhancedTypeDocumentationConfigurationTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/EnhancedTypeDocumentationConfigurationTest.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 EnhancedTypeDocumentationConfigurationTest { diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/EnhancedTypeTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/EnhancedTypeTest.java index 76bda6417c76..a8732a15aba4 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/EnhancedTypeTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/EnhancedTypeTest.java @@ -28,7 +28,7 @@ import java.util.SortedMap; import java.util.SortedSet; import java.util.concurrent.ConcurrentMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.mapper.StaticTableSchema; public class EnhancedTypeTest { diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/ExpressionTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/ExpressionTest.java index 055654c8fa6c..e0443dbd519f 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/ExpressionTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/ExpressionTest.java @@ -23,7 +23,7 @@ import java.util.HashMap; import java.util.Map; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.EnhancedAttributeValue; import software.amazon.awssdk.services.dynamodb.model.AttributeValue; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/KeyTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/KeyTest.java index 885302926417..ec47e04cec69 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/KeyTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/KeyTest.java @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItemWithIndices; import software.amazon.awssdk.services.dynamodb.model.AttributeValue; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/NestedAttributeNameTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/NestedAttributeNameTest.java index c5144d16fbd7..6f62657c28e0 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/NestedAttributeNameTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/NestedAttributeNameTest.java @@ -3,9 +3,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import java.util.Arrays; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class NestedAttributeNameTest { diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/ProjectionExpressionTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/ProjectionExpressionTest.java index 95128b7ff775..ec9a82197769 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/ProjectionExpressionTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/ProjectionExpressionTest.java @@ -3,8 +3,7 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.internal.ProjectionExpression; import java.util.Arrays; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/TableSchemaTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/TableSchemaTest.java index d42296dfe110..d0ab3ad46c4a 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/TableSchemaTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/TableSchemaTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem; import software.amazon.awssdk.enhanced.dynamodb.mapper.BeanTableSchema; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/TypeConvertingVisitorTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/TypeConvertingVisitorTest.java index b0aae190a287..2c403b37ad7e 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/TypeConvertingVisitorTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/TypeConvertingVisitorTest.java @@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.TypeConvertingVisitor; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.EnhancedAttributeValue; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/BinaryAttributeConvertersTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/BinaryAttributeConvertersTest.java index 14b36ca29f86..dea6566632a8 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/BinaryAttributeConvertersTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/BinaryAttributeConvertersTest.java @@ -21,7 +21,7 @@ import java.nio.ByteBuffer; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.enhanced.dynamodb.AttributeValueType; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.ByteArrayAttributeConverter; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/BooleanAttributeConvertersTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/BooleanAttributeConvertersTest.java index 75c6d2a953e6..a3974e3ee4e7 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/BooleanAttributeConvertersTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/BooleanAttributeConvertersTest.java @@ -22,7 +22,7 @@ import static software.amazon.awssdk.enhanced.dynamodb.converters.attribute.ConverterTestUtils.transformTo; import java.util.concurrent.atomic.AtomicBoolean; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.AtomicBooleanAttributeConverter; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.BooleanAttributeConverter; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.EnhancedAttributeValue; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/EnhancedAttributeValueTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/EnhancedAttributeValueTest.java index 07f669b96a8c..362d0c7b955a 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/EnhancedAttributeValueTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/EnhancedAttributeValueTest.java @@ -22,7 +22,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.enhanced.dynamodb.AttributeValueType; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.EnhancedAttributeValue; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/InstantAsStringAttributeConvertersTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/InstantAsStringAttributeConvertersTest.java index 7abccac079fc..ddbff47377a5 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/InstantAsStringAttributeConvertersTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/InstantAsStringAttributeConvertersTest.java @@ -21,7 +21,7 @@ import static software.amazon.awssdk.enhanced.dynamodb.converters.attribute.ConverterTestUtils.transformTo; import java.time.Instant; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.EnhancedAttributeValue; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.InstantAsStringAttributeConverter; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalDateAttributeConverterTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalDateAttributeConverterTest.java index ce4b4025464d..43e3170385a8 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalDateAttributeConverterTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalDateAttributeConverterTest.java @@ -6,7 +6,7 @@ import static software.amazon.awssdk.enhanced.dynamodb.converters.attribute.ConverterTestUtils.transformTo; import java.time.LocalDate; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.EnhancedAttributeValue; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.LocalDateAttributeConverter; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalDateTimeAttributeConverterTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalDateTimeAttributeConverterTest.java index 70a68b74c97f..73e901ace7b4 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalDateTimeAttributeConverterTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalDateTimeAttributeConverterTest.java @@ -21,7 +21,7 @@ import static software.amazon.awssdk.enhanced.dynamodb.converters.attribute.ConverterTestUtils.transformTo; import java.time.LocalDateTime; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.EnhancedAttributeValue; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.LocalDateTimeAttributeConverter; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalTimeAttributeConverterTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalTimeAttributeConverterTest.java index 584b8614841d..01d597c93acd 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalTimeAttributeConverterTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/LocalTimeAttributeConverterTest.java @@ -6,7 +6,7 @@ import static software.amazon.awssdk.enhanced.dynamodb.converters.attribute.ConverterTestUtils.transformTo; import java.time.LocalTime; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.EnhancedAttributeValue; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.LocalTimeAttributeConverter; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/MonthDayAttributeConverterTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/MonthDayAttributeConverterTest.java index 7e972ae32a87..75760c9a363d 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/MonthDayAttributeConverterTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/MonthDayAttributeConverterTest.java @@ -6,7 +6,7 @@ import static software.amazon.awssdk.enhanced.dynamodb.converters.attribute.ConverterTestUtils.transformTo; import java.time.MonthDay; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.EnhancedAttributeValue; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.MonthDayAttributeConverter; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/NumberAttributeConvertersTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/NumberAttributeConvertersTest.java index d9ba57f5e15c..bfbbf0ca6081 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/NumberAttributeConvertersTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/NumberAttributeConvertersTest.java @@ -26,7 +26,7 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.AttributeValueType; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.AtomicIntegerAttributeConverter; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.AtomicLongAttributeConverter; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/OffsetDateTimeAsStringAttributeConverterTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/OffsetDateTimeAsStringAttributeConverterTest.java index d7839a99d948..9f4f972b59d4 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/OffsetDateTimeAsStringAttributeConverterTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/OffsetDateTimeAsStringAttributeConverterTest.java @@ -8,7 +8,7 @@ import java.time.Instant; import java.time.OffsetDateTime; import java.time.ZoneOffset; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.EnhancedAttributeValue; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.OffsetDateTimeAsStringAttributeConverter; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/OptionalAttributeConvertersTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/OptionalAttributeConvertersTest.java index 31d1b2fb95d5..6f48a883005a 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/OptionalAttributeConvertersTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/OptionalAttributeConvertersTest.java @@ -24,7 +24,7 @@ import java.util.OptionalDouble; import java.util.OptionalInt; import java.util.OptionalLong; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.OptionalDoubleAttributeConverter; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.OptionalIntAttributeConverter; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.OptionalLongAttributeConverter; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/StringAttributeConvertersTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/StringAttributeConvertersTest.java index 2a6f608c8ad5..3ee5b55326fe 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/StringAttributeConvertersTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/StringAttributeConvertersTest.java @@ -37,7 +37,7 @@ import java.time.ZoneOffset; import java.util.Set; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.enhanced.dynamodb.AttributeValueType; import software.amazon.awssdk.enhanced.dynamodb.internal.AttributeValues; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/ZonedDateTimeAsStringAttributeConverterTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/ZonedDateTimeAsStringAttributeConverterTest.java index 3f44c03e2824..daf585bb4081 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/ZonedDateTimeAsStringAttributeConverterTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/converters/attribute/ZonedDateTimeAsStringAttributeConverterTest.java @@ -11,7 +11,7 @@ import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.temporal.ChronoUnit; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.EnhancedAttributeValue; import software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute.ZonedDateTimeAsStringAttributeConverter; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AnnotatedImmutableTableSchemaTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AnnotatedImmutableTableSchemaTest.java index 998f13998280..772f42936412 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AnnotatedImmutableTableSchemaTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AnnotatedImmutableTableSchemaTest.java @@ -17,8 +17,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; @@ -33,7 +33,7 @@ public class AnnotatedImmutableTableSchemaTest extends LocalDynamoDbSyncTestBase .dynamoDbClient(getDynamoDbClient()) .build(); - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName(TABLE_NAME)) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicControlPlaneTableOperationTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicControlPlaneTableOperationTest.java index d9060ccdfb89..b00b882aace7 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicControlPlaneTableOperationTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicControlPlaneTableOperationTest.java @@ -20,9 +20,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primarySortKey; import java.util.Objects; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; @@ -53,7 +53,7 @@ public class AsyncBasicControlPlaneTableOperationTest extends LocalDynamoDbAsync private final DynamoDbAsyncTable asyncMappedTable = enhancedAsyncClient.table(tableName, TABLE_SCHEMA); - @Before + @BeforeEach public void createTable() { asyncMappedTable.createTable( CreateTableEnhancedRequest.builder() @@ -62,7 +62,7 @@ public void createTable() { getDynamoDbAsyncClient().waiter().waitUntilTableExists(b -> b.tableName(tableName)).join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(tableName) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicCrudTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicCrudTest.java index 7901f42fe594..7bb534ddf130 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicCrudTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicCrudTest.java @@ -27,10 +27,10 @@ import java.util.Objects; import java.util.concurrent.CompletionException; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; @@ -219,7 +219,7 @@ public int hashCode() { @Rule public ExpectedException exception = ExpectedException.none(); - @Before + @BeforeEach public void createTable() { mappedTable.createTable( @@ -233,7 +233,7 @@ public void createTable() { .join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicQueryTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicQueryTest.java index b7fe4c041801..32330162c59c 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicQueryTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicQueryTest.java @@ -32,9 +32,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.core.async.SdkPublisher; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; @@ -129,12 +129,12 @@ private void insertRecords() { RECORDS.forEach(record -> mappedTable.putItem(r -> r.item(record)).join()); } - @Before + @BeforeEach public void createTable() { mappedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicScanTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicScanTest.java index e69ff876e4ad..23920a256c0e 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicScanTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBasicScanTest.java @@ -31,9 +31,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.core.async.SdkPublisher; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; @@ -113,12 +113,12 @@ private void insertRecords() { RECORDS.forEach(record -> mappedTable.putItem(r -> r.item(record)).join()); } - @Before + @BeforeEach public void createTable() { mappedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchGetItemTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchGetItemTest.java index 3c90d04562da..d48b3a54ae7d 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchGetItemTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchGetItemTest.java @@ -24,9 +24,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.core.async.SdkPublisher; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; @@ -130,13 +130,13 @@ public int hashCode() { .mapToObj(i -> new Record2().setId(i)) .collect(Collectors.toList()); - @Before + @BeforeEach public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); mappedTable2.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchWriteItemTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchWriteItemTest.java index bcc703e803c7..f0a72ce1c83c 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchWriteItemTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncBatchWriteItemTest.java @@ -26,9 +26,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; @@ -158,13 +158,13 @@ public int hashCode() { .mapToObj(i -> new Record2().setId(i).setAttribute(Integer.toString(i))) .collect(Collectors.toList()); - @Before + @BeforeEach public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); mappedTable2.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncDeleteItemWithResponseTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncDeleteItemWithResponseTest.java index d4c9c2492800..4e41f71c7153 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncDeleteItemWithResponseTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncDeleteItemWithResponseTest.java @@ -19,9 +19,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primaryPartitionKey; import java.util.Objects; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; import software.amazon.awssdk.enhanced.dynamodb.Key; @@ -88,7 +88,7 @@ public int hashCode() { private DynamoDbAsyncTable mappedTable1; - @Before + @BeforeEach public void createTable() { enhancedClient = DynamoDbEnhancedAsyncClient.builder() .dynamoDbClient(getDynamoDbAsyncClient()) @@ -99,7 +99,7 @@ public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncIndexQueryTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncIndexQueryTest.java index 0a53549e6f62..6f659d16b569 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncIndexQueryTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncIndexQueryTest.java @@ -33,9 +33,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.core.async.SdkPublisher; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncIndex; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; @@ -178,7 +178,7 @@ private void insertRecords() { RECORDS.forEach(record -> mappedTable.putItem(r -> r.item(record)).join()); } - @Before + @BeforeEach public void createTable() { mappedTable.createTable( CreateTableEnhancedRequest.builder() @@ -192,7 +192,7 @@ public void createTable() { .join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncIndexScanTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncIndexScanTest.java index 9de11ea5c0fd..537aa2f401eb 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncIndexScanTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncIndexScanTest.java @@ -33,9 +33,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.core.async.SdkPublisher; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncIndex; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; @@ -177,7 +177,7 @@ private void insertRecords() { RECORDS.forEach(record -> mappedTable.putItem(r -> r.item(record)).join()); } - @Before + @BeforeEach public void createTable() { mappedTable.createTable( r -> r.provisionedThroughput(getDefaultProvisionedThroughput()) @@ -189,7 +189,7 @@ public void createTable() { .join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncPutItemWithResponseTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncPutItemWithResponseTest.java index 275aea9106ed..109c8fc35b41 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncPutItemWithResponseTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncPutItemWithResponseTest.java @@ -19,13 +19,11 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primaryPartitionKey; import java.util.Objects; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; -import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; -import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; import software.amazon.awssdk.enhanced.dynamodb.mapper.StaticTableSchema; import software.amazon.awssdk.enhanced.dynamodb.model.PutItemEnhancedResponse; @@ -92,13 +90,13 @@ public int hashCode() { private final DynamoDbAsyncTable mappedTable1 = enhancedClient.table(getConcreteTableName("table-name-1"), TABLE_SCHEMA); - @Before + @BeforeEach public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())) .join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncTransactGetItemsTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncTransactGetItemsTest.java index 18c2466cddab..70a20cede793 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncTransactGetItemsTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncTransactGetItemsTest.java @@ -24,9 +24,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.enhanced.dynamodb.Document; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; @@ -128,13 +128,13 @@ public int hashCode() { .mapToObj(i -> new Record2().setId(i)) .collect(Collectors.toList()); - @Before + @BeforeEach public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); mappedTable2.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncTransactWriteItemsTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncTransactWriteItemsTest.java index 6a1348fd1cf2..11365ca6ebbd 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncTransactWriteItemsTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncTransactWriteItemsTest.java @@ -29,9 +29,9 @@ import java.util.concurrent.CompletionException; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; import software.amazon.awssdk.enhanced.dynamodb.Expression; @@ -163,13 +163,13 @@ public int hashCode() { .mapToObj(i -> new Record2().setId(i).setAttribute(Integer.toString(i))) .collect(Collectors.toList()); - @Before + @BeforeEach public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); mappedTable2.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncUpdateItemWithResponseTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncUpdateItemWithResponseTest.java index 6e4f5103d0f3..3f44b7e86f8d 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncUpdateItemWithResponseTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AsyncUpdateItemWithResponseTest.java @@ -19,9 +19,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primaryPartitionKey; import java.util.Objects; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; @@ -87,7 +87,7 @@ public int hashCode() { private DynamoDbAsyncTable mappedTable1; - @Before + @BeforeEach public void createTable() { enhancedClient = DynamoDbEnhancedAsyncClient.builder() .dynamoDbClient(getDynamoDbAsyncClient()) @@ -98,7 +98,7 @@ public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AutoGeneratedTimestampRecordTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AutoGeneratedTimestampRecordTest.java index d682fb4181e0..bdf08fbf7f41 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AutoGeneratedTimestampRecordTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/AutoGeneratedTimestampRecordTest.java @@ -32,10 +32,10 @@ import java.util.Objects; import java.util.UUID; import java.util.stream.IntStream; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import org.mockito.Mockito; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; @@ -135,13 +135,13 @@ public static Record createUniqueFakeItem() { return record; } - @Before + @BeforeEach public void createTable() { Mockito.when(mockCLock.instant()).thenReturn(MOCKED_INSTANT_NOW); mappedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicControlPlaneTableOperationTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicControlPlaneTableOperationTest.java index 42b380fa2a1d..0bb48f292c70 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicControlPlaneTableOperationTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicControlPlaneTableOperationTest.java @@ -20,9 +20,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primarySortKey; import java.util.Objects; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; @@ -53,7 +53,7 @@ public class BasicControlPlaneTableOperationTest extends LocalDynamoDbSyncTestBa private final DynamoDbTable mappedTable = enhancedClient.table(getConcreteTableName("table-name"), TABLE_SCHEMA); - @Before + @BeforeEach public void createTable() { mappedTable.createTable( CreateTableEnhancedRequest.builder() @@ -62,7 +62,7 @@ public void createTable() { getDynamoDbClient().waiter().waitUntilTableExists(b -> b.tableName(tableName)); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(tableName) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicCrudTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicCrudTest.java index 205d9ec86fe2..f05f87921008 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicCrudTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicCrudTest.java @@ -25,10 +25,10 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.secondarySortKey; import java.util.Objects; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; @@ -216,7 +216,7 @@ public int hashCode() { @Rule public ExpectedException exception = ExpectedException.none(); - @Before + @BeforeEach public void createTable() { mappedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput()) .globalSecondaryIndices( @@ -227,7 +227,7 @@ public void createTable() { .build())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicQueryTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicQueryTest.java index b3fcf4ab4098..7d8a955c7318 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicQueryTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicQueryTest.java @@ -31,9 +31,9 @@ import java.util.*; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.core.pagination.sync.SdkIterable; import software.amazon.awssdk.enhanced.dynamodb.*; import software.amazon.awssdk.enhanced.dynamodb.NestedAttributeName; @@ -150,14 +150,14 @@ private void insertNestedRecords() { NESTED_TEST_RECORDS.forEach(nestedTestRecord -> mappedNestedTable.putItem(r -> r.item(nestedTestRecord))); } - @Before + @BeforeEach public void createTable() { mappedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); mappedNestedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicScanTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicScanTest.java index b11666510d3c..7e1f5c135550 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicScanTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BasicScanTest.java @@ -26,9 +26,9 @@ import java.util.*; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.core.pagination.sync.SdkIterable; import software.amazon.awssdk.enhanced.dynamodb.*; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.InnerAttributeRecord; @@ -129,14 +129,14 @@ private void insertNestedRecords() { } - @Before + @BeforeEach public void createTable() { mappedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); mappedNestedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BatchGetItemTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BatchGetItemTest.java index 721739157e32..7bfe27be094d 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BatchGetItemTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BatchGetItemTest.java @@ -24,9 +24,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.core.pagination.sync.SdkIterable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; @@ -126,13 +126,13 @@ public int hashCode() { .mapToObj(i -> new Record2().setId(i)) .collect(Collectors.toList()); - @Before + @BeforeEach public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); mappedTable2.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BatchWriteItemTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BatchWriteItemTest.java index 536c34fe8da1..05c1c15154db 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BatchWriteItemTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BatchWriteItemTest.java @@ -24,9 +24,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; @@ -151,13 +151,13 @@ public int hashCode() { .mapToObj(i -> new Record2().setId(i).setAttribute(Integer.toString(i))) .collect(Collectors.toList()); - @Before + @BeforeEach public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); mappedTable2.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BeanTableSchemaRecursiveTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BeanTableSchemaRecursiveTest.java index e2919f9769c3..f2ffbe93614b 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BeanTableSchemaRecursiveTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/BeanTableSchemaRecursiveTest.java @@ -19,7 +19,7 @@ import java.util.Collections; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.RecursiveRecordBean; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.RecursiveRecordImmutable; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/DeleteItemWithResponseTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/DeleteItemWithResponseTest.java index 532bf220a842..7b77162b0bc2 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/DeleteItemWithResponseTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/DeleteItemWithResponseTest.java @@ -19,9 +19,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primaryPartitionKey; import java.util.Objects; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; import software.amazon.awssdk.enhanced.dynamodb.Key; @@ -88,7 +88,7 @@ public int hashCode() { private DynamoDbTable mappedTable1; - @Before + @BeforeEach public void createTable() { enhancedClient = DynamoDbEnhancedClient.builder() .dynamoDbClient(getDynamoDbClient()) @@ -99,7 +99,7 @@ public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FailedConversionAsyncTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FailedConversionAsyncTest.java index 9cb864bc38aa..43b214c49dbd 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FailedConversionAsyncTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FailedConversionAsyncTest.java @@ -15,13 +15,12 @@ package software.amazon.awssdk.enhanced.dynamodb.functionaltests; -import java.util.Iterator; import java.util.List; import java.util.concurrent.CompletionException; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedAsyncClient; @@ -55,12 +54,12 @@ public class FailedConversionAsyncTest extends LocalDynamoDbAsyncTestBase { @Rule public ExpectedException exception = ExpectedException.none(); - @Before + @BeforeEach public void createTable() { mappedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())).join(); } - @After + @AfterEach public void deleteTable() { getDynamoDbAsyncClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FailedConversionSyncTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FailedConversionSyncTest.java index db93471f8cba..aee6d7032168 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FailedConversionSyncTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FailedConversionSyncTest.java @@ -16,10 +16,10 @@ package software.amazon.awssdk.enhanced.dynamodb.functionaltests; import java.util.Iterator; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; @@ -29,7 +29,6 @@ import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeEnumRecord; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeEnumShortenedRecord; import software.amazon.awssdk.enhanced.dynamodb.model.Page; -import software.amazon.awssdk.enhanced.dynamodb.model.PageIterable; import software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -51,12 +50,12 @@ public class FailedConversionSyncTest extends LocalDynamoDbSyncTestBase { @Rule public ExpectedException exception = ExpectedException.none(); - @Before + @BeforeEach public void createTable() { mappedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FlattenTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FlattenTest.java index 69e410ac08df..992aeb23bb15 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FlattenTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FlattenTest.java @@ -20,9 +20,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primaryPartitionKey; import java.util.Objects; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; @@ -147,12 +147,12 @@ public int hashCode() { private DynamoDbTable mappedTable = enhancedClient.table(getConcreteTableName("table-name"), TABLE_SCHEMA); - @Before + @BeforeEach public void createTable() { mappedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FlattenWithTagsTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FlattenWithTagsTest.java index 5cda96444073..1547cb6e58c3 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FlattenWithTagsTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FlattenWithTagsTest.java @@ -22,9 +22,9 @@ import java.util.Objects; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; @@ -149,12 +149,12 @@ public int hashCode() { private DynamoDbTable mappedTable = enhancedClient.table(getConcreteTableName("table-name"), TABLE_SCHEMA); - @Before + @BeforeEach public void createTable() { mappedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/ImmutableTableSchemaRecursiveTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/ImmutableTableSchemaRecursiveTest.java index 308f3f405e0f..532160d99d05 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/ImmutableTableSchemaRecursiveTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/ImmutableTableSchemaRecursiveTest.java @@ -19,7 +19,7 @@ import java.util.Collections; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.RecursiveRecordBean; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.RecursiveRecordImmutable; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/IndexQueryTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/IndexQueryTest.java index e82e340e90ac..754b7fa644ce 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/IndexQueryTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/IndexQueryTest.java @@ -34,9 +34,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbIndex; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; @@ -177,7 +177,7 @@ private void insertRecords() { RECORDS.forEach(record -> mappedTable.putItem(r -> r.item(record))); } - @Before + @BeforeEach public void createTable() { mappedTable.createTable( CreateTableEnhancedRequest.builder() @@ -191,7 +191,7 @@ public void createTable() { .build()); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/IndexScanTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/IndexScanTest.java index 9cc674ed489a..3e0e2d58fd7b 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/IndexScanTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/IndexScanTest.java @@ -34,9 +34,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbIndex; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; @@ -175,7 +175,7 @@ private void insertRecords() { RECORDS.forEach(record -> mappedTable.putItem(r -> r.item(record))); } - @Before + @BeforeEach public void createTable() { mappedTable.createTable( r -> r.provisionedThroughput(getDefaultProvisionedThroughput()) @@ -187,7 +187,7 @@ public void createTable() { .build())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/PutItemWithResponseTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/PutItemWithResponseTest.java index cab8823dd1ec..6f5ba82be415 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/PutItemWithResponseTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/PutItemWithResponseTest.java @@ -20,9 +20,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primaryPartitionKey; import java.util.Objects; -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.mockito.Mockito; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClientExtension; @@ -93,7 +93,7 @@ public int hashCode() { private DynamoDbTable mappedTable1; - @Before + @BeforeEach public void createTable() { extension = Mockito.spy(new NoOpExtension()); @@ -107,7 +107,7 @@ public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/TransactGetItemsTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/TransactGetItemsTest.java index d5a12246dde2..02dfc9d98c30 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/TransactGetItemsTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/TransactGetItemsTest.java @@ -24,9 +24,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.enhanced.dynamodb.Document; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; @@ -124,13 +124,13 @@ public int hashCode() { .mapToObj(i -> new Record2().setId(i)) .collect(Collectors.toList()); - @Before + @BeforeEach public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); mappedTable2.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/TransactWriteItemsTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/TransactWriteItemsTest.java index b3f7b510d3d8..f816d7fa8dcc 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/TransactWriteItemsTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/TransactWriteItemsTest.java @@ -27,9 +27,9 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.IntStream; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; import software.amazon.awssdk.enhanced.dynamodb.Expression; @@ -37,13 +37,10 @@ import software.amazon.awssdk.enhanced.dynamodb.TableSchema; import software.amazon.awssdk.enhanced.dynamodb.mapper.StaticTableSchema; import software.amazon.awssdk.enhanced.dynamodb.model.ConditionCheck; -import software.amazon.awssdk.enhanced.dynamodb.model.DeleteItemEnhancedRequest; import software.amazon.awssdk.enhanced.dynamodb.model.TransactDeleteItemEnhancedRequest; import software.amazon.awssdk.enhanced.dynamodb.model.TransactPutItemEnhancedRequest; -import software.amazon.awssdk.enhanced.dynamodb.model.TransactPutItemEnhancedRequestTest; import software.amazon.awssdk.enhanced.dynamodb.model.TransactUpdateItemEnhancedRequest; import software.amazon.awssdk.enhanced.dynamodb.model.TransactWriteItemsEnhancedRequest; -import software.amazon.awssdk.enhanced.dynamodb.model.UpdateItemEnhancedRequest; import software.amazon.awssdk.services.dynamodb.model.CancellationReason; import software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest; import software.amazon.awssdk.services.dynamodb.model.ReturnValuesOnConditionCheckFailure; @@ -165,13 +162,13 @@ public int hashCode() { .mapToObj(i -> new Record2().setId(i).setAttribute(Integer.toString(i))) .collect(Collectors.toList()); - @Before + @BeforeEach public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); mappedTable2.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/UpdateBehaviorTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/UpdateBehaviorTest.java index ed693b66e702..6199b11db7d5 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/UpdateBehaviorTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/UpdateBehaviorTest.java @@ -2,9 +2,9 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; @@ -33,12 +33,12 @@ public class UpdateBehaviorTest extends LocalDynamoDbSyncTestBase { private final DynamoDbTable mappedTable = enhancedClient.table(getConcreteTableName("table-name"), TABLE_SCHEMA); - @Before + @BeforeEach public void createTable() { mappedTable.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(r -> r.tableName(getConcreteTableName("table-name"))); } diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/UpdateItemWithResponseTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/UpdateItemWithResponseTest.java index c7557f7542b8..da11594a352c 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/UpdateItemWithResponseTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/UpdateItemWithResponseTest.java @@ -19,9 +19,9 @@ import static software.amazon.awssdk.enhanced.dynamodb.mapper.StaticAttributeTags.primaryPartitionKey; import java.util.Objects; -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 software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; @@ -87,7 +87,7 @@ public int hashCode() { private DynamoDbTable mappedTable1; - @Before + @BeforeEach public void createTable() { enhancedClient = DynamoDbEnhancedClient.builder() .dynamoDbClient(getDynamoDbClient()) @@ -98,7 +98,7 @@ public void createTable() { mappedTable1.createTable(r -> r.provisionedThroughput(getDefaultProvisionedThroughput())); } - @After + @AfterEach public void deleteTable() { getDynamoDbClient().deleteTable(DeleteTableRequest.builder() .tableName(getConcreteTableName("table-name-1")) diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/ApplyUserAgentInterceptorTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/ApplyUserAgentInterceptorTest.java index 087171a8d6ea..9f1539765c39 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/ApplyUserAgentInterceptorTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/ApplyUserAgentInterceptorTest.java @@ -19,12 +19,11 @@ import java.util.List; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.RequestOverrideConfiguration; import software.amazon.awssdk.core.SdkField; import software.amazon.awssdk.core.SdkRequest; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; -import software.amazon.awssdk.core.util.VersionInfo; import software.amazon.awssdk.services.dynamodb.model.GetItemRequest; public class ApplyUserAgentInterceptorTest { diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/EnhancedClientUtilsTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/EnhancedClientUtilsTest.java index adb51a92cdab..6f85a6019c57 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/EnhancedClientUtilsTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/EnhancedClientUtilsTest.java @@ -20,7 +20,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.Key; import software.amazon.awssdk.enhanced.dynamodb.TableMetadata; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/converter/attribute/OptionalAttributeValueConverterTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/converter/attribute/OptionalAttributeValueConverterTest.java index 8cb798e71b7e..b7c9ee6d3abf 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/converter/attribute/OptionalAttributeValueConverterTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/converter/attribute/OptionalAttributeValueConverterTest.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.enhanced.dynamodb.internal.converter.attribute; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.dynamodb.model.AttributeValue; public class OptionalAttributeValueConverterTest { diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/extensions/DefaultDynamoDbExtensionContextTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/extensions/DefaultDynamoDbExtensionContextTest.java index 3befe2b6a56c..5d20d56e21d7 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/extensions/DefaultDynamoDbExtensionContextTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/extensions/DefaultDynamoDbExtensionContextTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.enhanced.dynamodb.internal.extensions; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.dynamodb.model.AttributeValue; public class DefaultDynamoDbExtensionContextTest { diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/immutable/ImmutableIntrospectorTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/immutable/ImmutableIntrospectorTest.java index 350467f4bc05..e59bfe2ae198 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/immutable/ImmutableIntrospectorTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/immutable/ImmutableIntrospectorTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbIgnore; import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbImmutable; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/mapper/MetaTableSchemaCacheTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/mapper/MetaTableSchemaCacheTest.java index cc191a7a7e1d..37e0592cce46 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/mapper/MetaTableSchemaCacheTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/mapper/MetaTableSchemaCacheTest.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.enhanced.dynamodb.functionaltests.models.FakeItem; public class MetaTableSchemaCacheTest { diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/DefaultOperationContextTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/DefaultOperationContextTest.java index 8c37782e588e..dc28a073ca7e 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/DefaultOperationContextTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/DefaultOperationContextTest.java @@ -19,7 +19,7 @@ import static org.junit.Assert.assertThat; import org.hamcrest.Matchers; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.TableMetadata; public class DefaultOperationContextTest { diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/ImmutableTableSchemaTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/ImmutableTableSchemaTest.java index 89f8a5ea76ee..3e97f4d4b660 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/ImmutableTableSchemaTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/ImmutableTableSchemaTest.java @@ -25,7 +25,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.mapper.testbeans.AbstractBean; import software.amazon.awssdk.enhanced.dynamodb.mapper.testbeans.AbstractImmutable; import software.amazon.awssdk.enhanced.dynamodb.mapper.testbeans.DocumentImmutable; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/StaticImmutableTableSchemaExtendTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/StaticImmutableTableSchemaExtendTest.java index a540fbd8449a..818f25cf38f6 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/StaticImmutableTableSchemaExtendTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/StaticImmutableTableSchemaExtendTest.java @@ -21,7 +21,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; import software.amazon.awssdk.services.dynamodb.model.AttributeValue; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/StaticImmutableTableSchemaFlattenTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/StaticImmutableTableSchemaFlattenTest.java index fde9d5db1259..bdf207c361cc 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/StaticImmutableTableSchemaFlattenTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mapper/StaticImmutableTableSchemaFlattenTest.java @@ -23,7 +23,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.TableSchema; import software.amazon.awssdk.services.dynamodb.model.AttributeValue; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mocktests/AsyncBatchGetItemTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mocktests/AsyncBatchGetItemTest.java index be9fc8cd9210..fc83e9af600b 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mocktests/AsyncBatchGetItemTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mocktests/AsyncBatchGetItemTest.java @@ -24,10 +24,10 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; import java.util.List; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.core.async.SdkPublisher; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; @@ -48,7 +48,7 @@ public class AsyncBatchGetItemTest { @Rule public WireMockRule wireMock = new WireMockRule(0); - @Before + @BeforeEach public void setup() { DynamoDbAsyncClient dynamoDbClient = @@ -72,7 +72,7 @@ public void setup() { table = enhancedClient.table("table", tableSchema); } - @After + @AfterEach public void cleanup() { wireMock.resetAll(); } diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mocktests/BatchGetItemTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mocktests/BatchGetItemTest.java index 41dc56faa8fa..99f325f6e4cb 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mocktests/BatchGetItemTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/mocktests/BatchGetItemTest.java @@ -25,9 +25,9 @@ import java.util.List; import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.util.stream.Collectors; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.core.pagination.sync.SdkIterable; import software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient; @@ -48,7 +48,7 @@ public class BatchGetItemTest { @Rule public WireMockRule wireMock = new WireMockRule(0); - @Before + @BeforeEach public void setup() { DynamoDbClient dynamoDbClient = diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/DeleteItemEnhancedResponseTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/DeleteItemEnhancedResponseTest.java index 7145c3a0a479..61402e415c12 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/DeleteItemEnhancedResponseTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/DeleteItemEnhancedResponseTest.java @@ -20,7 +20,7 @@ import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem; import software.amazon.awssdk.services.dynamodb.model.AttributeValue; import software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/DescribeTableEnhancedResponseTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/DescribeTableEnhancedResponseTest.java index 33bf8106d610..4d6e32018c81 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/DescribeTableEnhancedResponseTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/DescribeTableEnhancedResponseTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DescribeTableEnhancedResponseTest { diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/PutItemEnhancedResponseTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/PutItemEnhancedResponseTest.java index e7f057d23126..4c59f400cda2 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/PutItemEnhancedResponseTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/PutItemEnhancedResponseTest.java @@ -20,7 +20,7 @@ import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem; import software.amazon.awssdk.services.dynamodb.model.AttributeValue; import software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity; diff --git a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/UpdateItemEnhancedResponseTest.java b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/UpdateItemEnhancedResponseTest.java index 38a9726de008..06dce9078940 100644 --- a/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/UpdateItemEnhancedResponseTest.java +++ b/services-custom/dynamodb-enhanced/src/test/java/software/amazon/awssdk/enhanced/dynamodb/model/UpdateItemEnhancedResponseTest.java @@ -20,7 +20,7 @@ import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.enhanced.dynamodb.functionaltests.models.FakeItem; import software.amazon.awssdk.services.dynamodb.model.AttributeValue; import software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity; diff --git a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/CrtExceptionTransformationIntegrationTest.java b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/CrtExceptionTransformationIntegrationTest.java index 56d3ebd099d4..b85f74d9260d 100644 --- a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/CrtExceptionTransformationIntegrationTest.java +++ b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/CrtExceptionTransformationIntegrationTest.java @@ -21,9 +21,9 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; -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.services.s3.model.GetObjectRequest; import software.amazon.awssdk.services.s3.model.NoSuchBucketException; import software.amazon.awssdk.services.s3.model.NoSuchKeyException; @@ -42,7 +42,7 @@ public class CrtExceptionTransformationIntegrationTest extends S3IntegrationTest private static S3TransferManager transferManager; private static S3CrtAsyncClient s3Crt; - @BeforeClass + @BeforeAll public static void setupFixture() throws IOException { createBucket(BUCKET); testFile = new RandomTempFile(BUCKET, OBJ_SIZE); @@ -57,7 +57,7 @@ public static void setupFixture() throws IOException { .build(); } - @AfterClass + @AfterAll public static void tearDownFixture() { deleteBucketAndAllContents(BUCKET); s3Crt.close(); diff --git a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3CrtClientPutObjectIntegrationTest.java b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3CrtClientPutObjectIntegrationTest.java index 9e5fa71bb0b5..f69878a737c8 100644 --- a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3CrtClientPutObjectIntegrationTest.java +++ b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3CrtClientPutObjectIntegrationTest.java @@ -30,11 +30,11 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import org.assertj.core.api.Assertions; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.reactivestreams.Subscriber; import software.amazon.awssdk.core.ResponseBytes; import software.amazon.awssdk.core.ResponseInputStream; @@ -56,7 +56,7 @@ public class S3CrtClientPutObjectIntegrationTest extends S3IntegrationTestBase { private S3CrtAsyncClient s3Crt; - @BeforeClass + @BeforeAll public static void setup() throws Exception { S3IntegrationTestBase.setUp(); S3IntegrationTestBase.createBucket(TEST_BUCKET); @@ -65,7 +65,7 @@ public static void setup() throws Exception { executorService = Executors.newFixedThreadPool(2); } - @Before + @BeforeEach public void methodSetup() { s3Crt = S3CrtAsyncClient.builder() .credentialsProvider(CREDENTIALS_PROVIDER_CHAIN) @@ -73,12 +73,12 @@ public void methodSetup() { .build(); } - @After + @AfterEach public void methodTeardown() { s3Crt.close(); } - @AfterClass + @AfterAll public static void teardown() throws IOException { S3IntegrationTestBase.deleteBucketAndAllContents(TEST_BUCKET); Files.delete(testFile.toPath()); diff --git a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3CrtGetObjectIntegrationTest.java b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3CrtGetObjectIntegrationTest.java index eb80d2ae9058..f8ad754f77c8 100644 --- a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3CrtGetObjectIntegrationTest.java +++ b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3CrtGetObjectIntegrationTest.java @@ -26,9 +26,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -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.core.async.AsyncResponseTransformer; import software.amazon.awssdk.core.async.SdkPublisher; import software.amazon.awssdk.core.client.config.SdkAdvancedAsyncClientOption; @@ -47,7 +47,7 @@ public class S3CrtGetObjectIntegrationTest extends S3IntegrationTestBase { private static File file; private static ExecutorService executorService; - @BeforeClass + @BeforeAll public static void setup() throws IOException { S3IntegrationTestBase.createBucket(BUCKET); crtClient = S3CrtAsyncClient.builder() @@ -62,7 +62,7 @@ public static void setup() throws IOException { executorService = Executors.newFixedThreadPool(2); } - @AfterClass + @AfterAll public static void cleanup() { crtClient.close(); S3IntegrationTestBase.deleteBucketAndAllContents(BUCKET); diff --git a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3IntegrationTestBase.java b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3IntegrationTestBase.java index 2dcd74f9bd5a..bd56bcc64048 100644 --- a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3IntegrationTestBase.java +++ b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3IntegrationTestBase.java @@ -15,8 +15,8 @@ package software.amazon.awssdk.transfer.s3; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.crt.CrtResource; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.S3AsyncClient; @@ -55,14 +55,14 @@ public class S3IntegrationTestBase extends AwsTestBase { * Loads the AWS account info for the integration tests and creates an S3 * client for tests to use. */ - @BeforeClass + @BeforeAll public static void setUp() throws Exception { System.setProperty("aws.crt.debugnative", "true"); s3 = s3ClientBuilder().build(); s3Async = s3AsyncClientBuilder().build(); } - @AfterClass + @AfterAll public static void cleanUp() { CrtResource.waitForNoResources(); } diff --git a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerDownloadIntegrationTest.java b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerDownloadIntegrationTest.java index 124117637779..b8f6980543c0 100644 --- a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerDownloadIntegrationTest.java +++ b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerDownloadIntegrationTest.java @@ -21,9 +21,9 @@ import java.io.File; import java.io.IOException; import java.nio.file.Path; -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.core.ResponseBytes; import software.amazon.awssdk.core.async.AsyncResponseTransformer; import software.amazon.awssdk.services.s3.model.GetObjectResponse; @@ -39,7 +39,7 @@ public class S3TransferManagerDownloadIntegrationTest extends S3IntegrationTestB private static S3TransferManager tm; private static File file; - @BeforeClass + @BeforeAll public static void setup() throws IOException { createBucket(BUCKET); file = new RandomTempFile(OBJ_SIZE); @@ -53,7 +53,7 @@ public static void setup() throws IOException { .build(); } - @AfterClass + @AfterAll public static void cleanup() { deleteBucketAndAllContents(BUCKET); tm.close(); diff --git a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadDirectoryIntegrationTest.java b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadDirectoryIntegrationTest.java index caa9c913afde..0b15914ddda0 100644 --- a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadDirectoryIntegrationTest.java +++ b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadDirectoryIntegrationTest.java @@ -28,9 +28,9 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; 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 software.amazon.awssdk.core.sync.ResponseTransformer; import software.amazon.awssdk.services.s3.S3Client; import software.amazon.awssdk.services.s3.model.S3Object; @@ -46,7 +46,7 @@ public class S3TransferManagerUploadDirectoryIntegrationTest extends S3Integrati private static S3Client s3Client; private static String randomString; - @BeforeClass + @BeforeAll public static void setUp() throws Exception { S3IntegrationTestBase.setUp(); createBucket(TEST_BUCKET); @@ -64,7 +64,7 @@ public static void setUp() throws Exception { .build(); } - @AfterClass + @AfterAll public static void teardown() { try { FileUtils.cleanUpTestDirectory(directory); diff --git a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadIntegrationTest.java b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadIntegrationTest.java index 9125d0c1a416..0286dd445608 100644 --- a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadIntegrationTest.java +++ b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadIntegrationTest.java @@ -22,9 +22,9 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.UUID; -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.core.ResponseInputStream; import software.amazon.awssdk.core.async.AsyncRequestBody; import software.amazon.awssdk.core.sync.ResponseTransformer; @@ -41,7 +41,7 @@ public class S3TransferManagerUploadIntegrationTest extends S3IntegrationTestBas private static RandomTempFile testFile; private static S3TransferManager tm; - @BeforeClass + @BeforeAll public static void setUp() throws Exception { S3IntegrationTestBase.setUp(); createBucket(TEST_BUCKET); @@ -56,7 +56,7 @@ public static void setUp() throws Exception { } - @AfterClass + @AfterAll public static void teardown() throws IOException { tm.close(); Files.delete(testFile.toPath()); diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedDirectoryUploadTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedDirectoryUploadTest.java index 4d18abc06ce6..9e6d30d0df03 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedDirectoryUploadTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedDirectoryUploadTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.transfer.s3; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class CompletedDirectoryUploadTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedDownloadTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedDownloadTest.java index bfc90e8128cd..44fcc241c603 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedDownloadTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedDownloadTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class CompletedDownloadTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedFileDownloadTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedFileDownloadTest.java index 1ff2e059f891..6b2234d74178 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedFileDownloadTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedFileDownloadTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class CompletedFileDownloadTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedFileUploadTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedFileUploadTest.java index 807668c5012e..6900e08e9269 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedFileUploadTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedFileUploadTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class CompletedFileUploadTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedUploadTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedUploadTest.java index 7f3738de6c4a..d097f5d86328 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedUploadTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/CompletedUploadTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class CompletedUploadTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/DownloadFileRequestTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/DownloadFileRequestTest.java index 7d59dfc43e78..557995162290 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/DownloadFileRequestTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/DownloadFileRequestTest.java @@ -22,7 +22,7 @@ import java.nio.file.Paths; import nl.jqno.equalsverifier.EqualsVerifier; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; public class DownloadFileRequestTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/DownloadRequestTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/DownloadRequestTest.java index a83e73347a77..2c434b9d3946 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/DownloadRequestTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/DownloadRequestTest.java @@ -19,7 +19,7 @@ import nl.jqno.equalsverifier.EqualsVerifier; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.core.ResponseBytes; import software.amazon.awssdk.core.async.AsyncResponseTransformer; diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/FailedFileUploadTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/FailedFileUploadTest.java index 828e1e8ced40..d15df196701e 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/FailedFileUploadTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/FailedFileUploadTest.java @@ -19,7 +19,7 @@ import java.nio.file.Paths; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.exception.SdkClientException; public class FailedFileUploadTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/S3ClientConfigurationTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/S3ClientConfigurationTest.java index ec2a2b67de6e..a30b970f8b91 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/S3ClientConfigurationTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/S3ClientConfigurationTest.java @@ -20,7 +20,7 @@ import static software.amazon.awssdk.transfer.s3.SizeConstant.MB; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; import software.amazon.awssdk.regions.Region; diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/S3TransferManagerOverrideConfigurationTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/S3TransferManagerOverrideConfigurationTest.java index 00fa560be571..b126e7944338 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/S3TransferManagerOverrideConfigurationTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/S3TransferManagerOverrideConfigurationTest.java @@ -19,7 +19,7 @@ import java.util.concurrent.Executor; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; public class S3TransferManagerOverrideConfigurationTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadDirectoryOverrideConfigurationTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadDirectoryOverrideConfigurationTest.java index 09a8fa590867..c900aff1e722 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadDirectoryOverrideConfigurationTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadDirectoryOverrideConfigurationTest.java @@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class UploadDirectoryOverrideConfigurationTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadDirectoryRequestTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadDirectoryRequestTest.java index 896bfc8d67f7..ad973444de5d 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadDirectoryRequestTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadDirectoryRequestTest.java @@ -19,7 +19,7 @@ import java.nio.file.Paths; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class UploadDirectoryRequestTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadFileRequestTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadFileRequestTest.java index 6fea04afe0b0..1b08a6627994 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadFileRequestTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadFileRequestTest.java @@ -22,7 +22,7 @@ import java.nio.file.Paths; import nl.jqno.equalsverifier.EqualsVerifier; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.services.s3.model.PutObjectRequest; diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadRequestTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadRequestTest.java index 5fc97c2c8312..f86c6aee4b86 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadRequestTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/UploadRequestTest.java @@ -19,7 +19,7 @@ import nl.jqno.equalsverifier.EqualsVerifier; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.core.async.AsyncRequestBody; import software.amazon.awssdk.services.s3.model.PutObjectRequest; diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/CrtCredentialProviderAdapterTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/CrtCredentialProviderAdapterTest.java index b3769c02b383..72a1d97db426 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/CrtCredentialProviderAdapterTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/CrtCredentialProviderAdapterTest.java @@ -20,7 +20,7 @@ import static org.mockito.Mockito.when; import java.nio.charset.StandardCharsets; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentials; diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultDirectoryUploadTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultDirectoryUploadTest.java index 2690a2fdb14c..91018de30119 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultDirectoryUploadTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultDirectoryUploadTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.transfer.s3.internal; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.transfer.s3.UploadRequest; public class DefaultDirectoryUploadTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultDownloadTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultDownloadTest.java index 4d5889e9bb2a..cb9b7ff44112 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultDownloadTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultDownloadTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.transfer.s3.internal; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DefaultDownloadTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultFileDownloadTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultFileDownloadTest.java index a07cb6a26cb1..be96e0b8bd0a 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultFileDownloadTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultFileDownloadTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.transfer.s3.internal; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DefaultFileDownloadTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultFileUploadTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultFileUploadTest.java index c0f36785482d..a694ef8b3a83 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultFileUploadTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultFileUploadTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.transfer.s3.internal; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DefaultFileUploadTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultTransferProgressSnapshotTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultTransferProgressSnapshotTest.java index 58713ca19e98..1d455d4e32c2 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultTransferProgressSnapshotTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultTransferProgressSnapshotTest.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.transfer.s3.internal.progress.DefaultTransferProgressSnapshot; import software.amazon.awssdk.transfer.s3.progress.TransferProgressSnapshot; diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultUploadTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultUploadTest.java index b08cc523dcb3..084c058bdbe5 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultUploadTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/DefaultUploadTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.transfer.s3.internal; import nl.jqno.equalsverifier.EqualsVerifier; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DefaultUploadTest { diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/RequestDataSupplierAdapterTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/RequestDataSupplierAdapterTest.java index b01cada9e1c6..ecd49477593a 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/RequestDataSupplierAdapterTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/RequestDataSupplierAdapterTest.java @@ -26,10 +26,9 @@ import java.util.Arrays; import java.util.List; import java.util.Optional; -import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; import java.util.stream.Stream; -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/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/ResponseHeadersHandlerTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/ResponseHeadersHandlerTest.java index 847517181623..fde79558b417 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/ResponseHeadersHandlerTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/ResponseHeadersHandlerTest.java @@ -19,14 +19,14 @@ import java.util.List; import java.util.Map; -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; public class ResponseHeadersHandlerTest { private ResponseHeadersHandler handler; - @Before + @BeforeEach public void setUp() { handler = new ResponseHeadersHandler(); } diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3CrtDataPublisherTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3CrtDataPublisherTest.java index 28d2ac3ff1d1..9e5a0089d621 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3CrtDataPublisherTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3CrtDataPublisherTest.java @@ -27,8 +27,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.lang3.RandomUtils; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; @@ -36,7 +36,7 @@ public class S3CrtDataPublisherTest { private S3CrtDataPublisher dataPublisher; - @Before + @BeforeEach public void setup() { dataPublisher = new S3CrtDataPublisher(); } diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3CrtPojoConversionTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3CrtPojoConversionTest.java index fcea2c0810db..c690a74080e9 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3CrtPojoConversionTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3CrtPojoConversionTest.java @@ -31,7 +31,7 @@ import java.util.Map; import java.util.Random; import org.apache.commons.lang3.RandomStringUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.signer.AwsS3V4Signer; import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration; diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3TransferManagerListenerTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3TransferManagerListenerTest.java index 716e03b94560..dd5d0729b29f 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3TransferManagerListenerTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3TransferManagerListenerTest.java @@ -37,9 +37,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.ThreadLocalRandom; -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.mockito.ArgumentCaptor; import org.mockito.stubbing.Answer; import software.amazon.awssdk.core.ResponseBytes; @@ -68,7 +68,7 @@ public class S3TransferManagerListenerTest { private S3TransferManager tm; private long contentLength; - @Before + @BeforeEach public void methodSetup() { s3Crt = mock(S3CrtAsyncClient.class); tm = new DefaultS3TransferManager(s3Crt, mock(UploadDirectoryHelper.class), mock(TransferManagerConfiguration.class)); @@ -79,7 +79,7 @@ public void methodSetup() { .thenAnswer(randomGetResponseBody(contentLength)); } - @After + @AfterEach public void methodTeardown() { tm.close(); } diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3TransferManagerTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3TransferManagerTest.java index 86c61bcedf78..ea05989defd6 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3TransferManagerTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/S3TransferManagerTest.java @@ -24,9 +24,9 @@ import java.nio.file.Paths; import java.util.concurrent.CompletableFuture; -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 software.amazon.awssdk.core.ResponseBytes; import software.amazon.awssdk.core.async.AsyncRequestBody; import software.amazon.awssdk.core.async.AsyncResponseTransformer; @@ -49,7 +49,7 @@ public class S3TransferManagerTest { private UploadDirectoryHelper uploadDirectoryManager; private TransferManagerConfiguration configuration; - @Before + @BeforeEach public void methodSetup() { mockS3Crt = mock(S3CrtAsyncClient.class); uploadDirectoryManager = mock(UploadDirectoryHelper.class); @@ -57,7 +57,7 @@ public void methodSetup() { tm = new DefaultS3TransferManager(mockS3Crt, uploadDirectoryManager, configuration); } - @After + @AfterEach public void methodTeardown() { tm.close(); } diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/TransferManagerConfigurationTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/TransferManagerConfigurationTest.java index 443dd4539cfa..8f23a18a0ac5 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/TransferManagerConfigurationTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/TransferManagerConfigurationTest.java @@ -25,7 +25,7 @@ import java.nio.file.Paths; import java.util.concurrent.ExecutorService; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import software.amazon.awssdk.transfer.s3.UploadDirectoryOverrideConfiguration; import software.amazon.awssdk.transfer.s3.UploadDirectoryRequest; diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/UploadDirectoryHelperTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/UploadDirectoryHelperTest.java index f1518978cacd..564838016d56 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/UploadDirectoryHelperTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/internal/UploadDirectoryHelperTest.java @@ -34,10 +34,10 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.function.Function; -import org.junit.AfterClass; -import org.junit.Before; -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.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import software.amazon.awssdk.core.exception.SdkClientException; import software.amazon.awssdk.services.s3.model.PutObjectRequest; @@ -59,7 +59,7 @@ public class UploadDirectoryHelperTest { private Function singleUploadFunction; private UploadDirectoryHelper uploadDirectoryHelper; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { jimfs = Jimfs.newFileSystem(); directory = jimfs.getPath("test"); @@ -68,12 +68,12 @@ public static void setUp() throws IOException { Files.createFile(jimfs.getPath("test/2")); } - @AfterClass + @AfterAll public static void tearDown() throws IOException { jimfs.close(); } - @Before + @BeforeEach public void methodSetup() { singleUploadFunction = mock(Function.class); uploadDirectoryHelper = new UploadDirectoryHelper(TransferManagerConfiguration.builder().build(), singleUploadFunction); diff --git a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/progress/LoggingTransferListenerTest.java b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/progress/LoggingTransferListenerTest.java index 2ea46b74fe85..aa135c8b9a42 100644 --- a/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/progress/LoggingTransferListenerTest.java +++ b/services-custom/s3-transfer-manager/src/test/java/software/amazon/awssdk/transfer/s3/progress/LoggingTransferListenerTest.java @@ -21,8 +21,8 @@ import java.util.List; import org.apache.log4j.Level; import org.apache.log4j.spi.LoggingEvent; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.testutils.LogCaptor; import software.amazon.awssdk.transfer.s3.CompletedObjectTransfer; import software.amazon.awssdk.transfer.s3.TransferObjectRequest; @@ -38,7 +38,7 @@ public class LoggingTransferListenerTest { private TransferListenerContext context; private LoggingTransferListener listener; - @Before + @BeforeEach public void setUp() throws Exception { TransferProgressSnapshot snapshot = DefaultTransferProgressSnapshot.builder() .transferSizeInBytes(TRANSFER_SIZE_IN_BYTES) diff --git a/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/GetExportIntegrationTest.java b/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/GetExportIntegrationTest.java index c228bc589d0a..52781ed2052d 100644 --- a/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/GetExportIntegrationTest.java +++ b/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/GetExportIntegrationTest.java @@ -18,17 +18,17 @@ import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.testutils.Waiter; /** * Integration tests for {@link software.amazon.awssdk.services.apigateway.model.GetExportRequest}. */ -@Ignore // Running during release causing TooManyRequests exception +@Disabled // Running during release causing TooManyRequests exception public class GetExportIntegrationTest extends IntegrationTestBase { private static final String STAGE = "Alpha"; @@ -36,7 +36,7 @@ public class GetExportIntegrationTest extends IntegrationTestBase { private static String restApiId; private static String deploymentId; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { IntegrationTestBase.setUp(); restApi = SdkBytes.fromInputStream(GetExportIntegrationTest.class.getResourceAsStream("/PetStore-Alpha-swagger-apigateway.json")); @@ -44,7 +44,7 @@ public static void setUp() throws IOException { deploymentId = apiGateway.createDeployment(r -> r.stageName(STAGE).restApiId(restApiId)).id(); } - @AfterClass + @AfterAll public static void teardown() { Waiter.run(() -> apiGateway.deleteStage(r -> r.restApiId(restApiId).stageName(STAGE))).orFail(); Waiter.run(() -> apiGateway.deleteDeployment(r -> r.deploymentId(deploymentId).restApiId(restApiId))).orFail(); diff --git a/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/IntegrationTestBase.java b/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/IntegrationTestBase.java index d9e3d0803a40..edc2ba741677 100644 --- a/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/IntegrationTestBase.java +++ b/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/IntegrationTestBase.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.services.apigateway; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.testutils.service.AwsTestBase; @@ -24,7 +24,7 @@ public class IntegrationTestBase extends AwsTestBase { protected static ApiGatewayClient apiGateway; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { apiGateway = ApiGatewayClient.builder().region(Region.US_EAST_1).credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); } diff --git a/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/ServiceIntegrationTest.java b/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/ServiceIntegrationTest.java index 3c1ae4ace1fe..f8bca72d3a24 100644 --- a/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/ServiceIntegrationTest.java +++ b/services/apigateway/src/it/java/software/amazon/awssdk/services/apigateway/ServiceIntegrationTest.java @@ -17,9 +17,9 @@ import java.util.List; import junit.framework.Assert; -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.services.apigateway.model.CreateApiKeyRequest; import software.amazon.awssdk.services.apigateway.model.CreateApiKeyResponse; import software.amazon.awssdk.services.apigateway.model.CreateResourceRequest; @@ -55,7 +55,7 @@ public class ServiceIntegrationTest extends IntegrationTestBase { private static String restApiId = null; - @BeforeClass + @BeforeAll public static void createRestApi() { CreateRestApiResponse createRestApiResult = apiGateway.createRestApi( CreateRestApiRequest.builder().name(NAME) @@ -72,7 +72,7 @@ public static void createRestApi() { restApiId = createRestApiResult.id(); } - @AfterClass + @AfterAll public static void deleteRestApiKey() { if (restApiId != null) { apiGateway.deleteRestApi(DeleteRestApiRequest.builder().restApiId(restApiId).build()); diff --git a/services/applicationautoscaling/src/it/java/software/amazon/awssdk/services/applicationautoscaling/ServiceIntegrationTest.java b/services/applicationautoscaling/src/it/java/software/amazon/awssdk/services/applicationautoscaling/ServiceIntegrationTest.java index 4ab1cbd5bdc5..d80570ccd3e0 100644 --- a/services/applicationautoscaling/src/it/java/software/amazon/awssdk/services/applicationautoscaling/ServiceIntegrationTest.java +++ b/services/applicationautoscaling/src/it/java/software/amazon/awssdk/services/applicationautoscaling/ServiceIntegrationTest.java @@ -16,8 +16,8 @@ package software.amazon.awssdk.services.applicationautoscaling; import org.junit.Assert; -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.StaticCredentialsProvider; import software.amazon.awssdk.services.applicationautoscaling.model.DescribeScalingPoliciesRequest; import software.amazon.awssdk.services.applicationautoscaling.model.DescribeScalingPoliciesResponse; @@ -28,7 +28,7 @@ public class ServiceIntegrationTest extends AwsIntegrationTestBase { private static ApplicationAutoScalingClient autoscaling; - @BeforeClass + @BeforeAll public static void setUp() { autoscaling = ApplicationAutoScalingClient.builder() .credentialsProvider(StaticCredentialsProvider.create(getCredentials())) diff --git a/services/autoscaling/src/it/java/software/amazon/awssdk/services/autoscaling/AutoScalingIntegrationTest.java b/services/autoscaling/src/it/java/software/amazon/awssdk/services/autoscaling/AutoScalingIntegrationTest.java index d733b8aac478..0f704e7a14bb 100644 --- a/services/autoscaling/src/it/java/software/amazon/awssdk/services/autoscaling/AutoScalingIntegrationTest.java +++ b/services/autoscaling/src/it/java/software/amazon/awssdk/services/autoscaling/AutoScalingIntegrationTest.java @@ -30,8 +30,8 @@ import java.util.List; import java.util.Map; import org.apache.commons.codec.binary.Base64; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkGlobalTime; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.autoscaling.model.AlreadyExistsException; @@ -135,7 +135,7 @@ public class AutoScalingIntegrationTest extends IntegrationTestBase { * Releases any resources created by these tests */ - @After + @AfterEach public void tearDown() { if (autoScalingGroupName != null) { try { diff --git a/services/autoscaling/src/it/java/software/amazon/awssdk/services/autoscaling/IntegrationTestBase.java b/services/autoscaling/src/it/java/software/amazon/awssdk/services/autoscaling/IntegrationTestBase.java index 167317fe81a9..4ea145bc1fa5 100644 --- a/services/autoscaling/src/it/java/software/amazon/awssdk/services/autoscaling/IntegrationTestBase.java +++ b/services/autoscaling/src/it/java/software/amazon/awssdk/services/autoscaling/IntegrationTestBase.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.services.autoscaling; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.autoscaling.model.CreateLaunchConfigurationRequest; import software.amazon.awssdk.services.sns.SnsClient; @@ -51,7 +51,7 @@ public abstract class IntegrationTestBase extends AwsTestBase { * Loads the AWS account info for the integration tests and creates an AutoScaling client for * tests to use. */ - @BeforeClass + @BeforeAll public static void setUp() throws IOException { setUpCredentials(); autoscaling = AutoScalingClient.builder() diff --git a/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/ClockSkewIntegrationTest.java b/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/ClockSkewIntegrationTest.java index 592b22e42938..ff1b77b0eefd 100644 --- a/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/ClockSkewIntegrationTest.java +++ b/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/ClockSkewIntegrationTest.java @@ -17,7 +17,7 @@ import static org.junit.Assert.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkGlobalTime; import software.amazon.awssdk.services.cloudformation.model.DescribeStacksRequest; diff --git a/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/CloudFormationIntegrationTestBase.java b/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/CloudFormationIntegrationTestBase.java index ea3ffac251a6..f43b76590253 100644 --- a/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/CloudFormationIntegrationTestBase.java +++ b/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/CloudFormationIntegrationTestBase.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.services.cloudformation; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.testutils.service.AwsTestBase; @@ -31,7 +31,7 @@ public class CloudFormationIntegrationTestBase extends AwsTestBase { * Loads the AWS account info for the integration tests and creates an S3 client for tests to * use. */ - @BeforeClass + @BeforeAll public static void setUp() throws Exception { cf = CloudFormationClient.builder() .credentialsProvider(CREDENTIALS_PROVIDER_CHAIN) diff --git a/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/SendEmptyListIntegrationTest.java b/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/SendEmptyListIntegrationTest.java index 5ff67944b7cc..c509e2246c7f 100644 --- a/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/SendEmptyListIntegrationTest.java +++ b/services/cloudformation/src/it/java/software/amazon/awssdk/services/cloudformation/SendEmptyListIntegrationTest.java @@ -21,9 +21,9 @@ import java.util.Collections; import java.util.List; -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 software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.cloudformation.model.CreateStackRequest; @@ -64,7 +64,7 @@ public class SendEmptyListIntegrationTest extends AwsIntegrationTestBase { private CloudFormationWaiter waiter; private String stackName; - @Before + @BeforeEach public void setup() { stackName = getClass().getSimpleName() + "-" + System.currentTimeMillis(); cf = CloudFormationClient.builder() @@ -81,7 +81,7 @@ public void setup() { waiter.waitUntilStackCreateComplete(b -> b.stackName(stackName)); } - @After + @AfterEach public void tearDown() { cf.deleteStack(DeleteStackRequest.builder().stackName(stackName).build()); } diff --git a/services/cloudhsm/src/it/java/software/amazon/awssdk/services/cloudhsm/IntegrationTestBase.java b/services/cloudhsm/src/it/java/software/amazon/awssdk/services/cloudhsm/IntegrationTestBase.java index 424ad090273c..aa4e1573098f 100644 --- a/services/cloudhsm/src/it/java/software/amazon/awssdk/services/cloudhsm/IntegrationTestBase.java +++ b/services/cloudhsm/src/it/java/software/amazon/awssdk/services/cloudhsm/IntegrationTestBase.java @@ -15,14 +15,14 @@ package software.amazon.awssdk.services.cloudhsm; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.testutils.service.AwsTestBase; public class IntegrationTestBase extends AwsTestBase { protected static CloudHsmClient client; - @BeforeClass + @BeforeAll public static void setup() throws Exception { setUpCredentials(); client = CloudHsmClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); diff --git a/services/cloudsearch/src/it/java/software/amazon/awssdk/services/cloudsearch/CloudSearchv2IntegrationTest.java b/services/cloudsearch/src/it/java/software/amazon/awssdk/services/cloudsearch/CloudSearchv2IntegrationTest.java index 85838e4037bd..0fdc1809fddc 100644 --- a/services/cloudsearch/src/it/java/software/amazon/awssdk/services/cloudsearch/CloudSearchv2IntegrationTest.java +++ b/services/cloudsearch/src/it/java/software/amazon/awssdk/services/cloudsearch/CloudSearchv2IntegrationTest.java @@ -23,10 +23,10 @@ import java.time.Duration; import java.time.Instant; import java.util.List; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.services.cloudsearch.model.AccessPoliciesStatus; import software.amazon.awssdk.services.cloudsearch.model.AnalysisScheme; @@ -114,7 +114,7 @@ public class CloudSearchv2IntegrationTest extends AwsIntegrationTestBase { * Sets up the credenitals and creates an instance of the Amazon Cloud * Search client used for different test case executions. */ - @BeforeClass + @BeforeAll public static void setUp() throws Exception { cloudSearch = CloudSearchClient.builder().credentialsProvider(StaticCredentialsProvider.create(getCredentials())).build(); } @@ -124,7 +124,7 @@ public static void setUp() throws Exception { * execution. This is done to ensure that the state of domain is in * consistent state before and after the test case execution. */ - @Before + @BeforeEach public void createDomain() { testDomainName = testDomainNamePrefix + System.currentTimeMillis(); @@ -136,7 +136,7 @@ public void createDomain() { /** * Deletes the Amazon Cloud Search domain after every test case execution. */ - @After + @AfterEach public void deleteDomain() { cloudSearch.deleteDomain(DeleteDomainRequest.builder() .domainName(testDomainName).build()); diff --git a/services/cloudsearchdomain/src/test/java/software/amazon/awssdk/cloudsearchdomain/SearchRequestUnitTest.java b/services/cloudsearchdomain/src/test/java/software/amazon/awssdk/cloudsearchdomain/SearchRequestUnitTest.java index b1dd78002dbf..33f905e5366b 100644 --- a/services/cloudsearchdomain/src/test/java/software/amazon/awssdk/cloudsearchdomain/SearchRequestUnitTest.java +++ b/services/cloudsearchdomain/src/test/java/software/amazon/awssdk/cloudsearchdomain/SearchRequestUnitTest.java @@ -28,9 +28,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.io.IOException; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; @@ -48,7 +48,7 @@ public class SearchRequestUnitTest { private CloudSearchDomainClient searchClient; - @Before + @BeforeEach public void testSetup() { searchClient = CloudSearchDomainClient.builder() .credentialsProvider(StaticCredentialsProvider.create(CREDENTIALS)) diff --git a/services/cloudtrail/src/it/java/software/amazon/awssdk/services/cloudtrail/CloudTrailIntegrationTest.java b/services/cloudtrail/src/it/java/software/amazon/awssdk/services/cloudtrail/CloudTrailIntegrationTest.java index f287a6a1f93e..4cf2e7e784bc 100644 --- a/services/cloudtrail/src/it/java/software/amazon/awssdk/services/cloudtrail/CloudTrailIntegrationTest.java +++ b/services/cloudtrail/src/it/java/software/amazon/awssdk/services/cloudtrail/CloudTrailIntegrationTest.java @@ -24,9 +24,9 @@ import java.io.IOException; import java.util.Iterator; import org.apache.commons.io.IOUtils; -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.services.cloudtrail.model.CreateTrailRequest; import software.amazon.awssdk.services.cloudtrail.model.CreateTrailResponse; import software.amazon.awssdk.services.cloudtrail.model.DeleteTrailRequest; @@ -57,7 +57,7 @@ public class CloudTrailIntegrationTest extends IntegrationTestBase { */ private static final String POLICY_FILE = "/software/amazon/awssdk/services/cloudtrail/samplePolicy.json"; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { IntegrationTestBase.setUp(); s3.createBucket(CreateBucketRequest.builder() @@ -69,7 +69,7 @@ public static void setUp() throws IOException { .build()); } - @AfterClass + @AfterAll public static void tearDown() { deleteBucketAndAllContents(BUCKET_NAME); diff --git a/services/cloudtrail/src/it/java/software/amazon/awssdk/services/cloudtrail/IntegrationTestBase.java b/services/cloudtrail/src/it/java/software/amazon/awssdk/services/cloudtrail/IntegrationTestBase.java index 3810ddba3d54..206233ad30a4 100644 --- a/services/cloudtrail/src/it/java/software/amazon/awssdk/services/cloudtrail/IntegrationTestBase.java +++ b/services/cloudtrail/src/it/java/software/amazon/awssdk/services/cloudtrail/IntegrationTestBase.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.services.cloudtrail; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.S3Client; @@ -28,7 +28,7 @@ public class IntegrationTestBase extends AwsIntegrationTestBase { protected static S3Client s3; protected static Region region = Region.US_WEST_2; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { System.setProperty("software.amazon.awssdk.sdk.disableCertChecking", "true"); cloudTrail = CloudTrailClient.builder().credentialsProvider(StaticCredentialsProvider.create(getCredentials())).build(); diff --git a/services/cloudwatch/src/it/java/software/amazon/awssdk/services/cloudwatch/CloudWatchIntegrationTest.java b/services/cloudwatch/src/it/java/software/amazon/awssdk/services/cloudwatch/CloudWatchIntegrationTest.java index 640dcb076048..72f4bdd029cd 100644 --- a/services/cloudwatch/src/it/java/software/amazon/awssdk/services/cloudwatch/CloudWatchIntegrationTest.java +++ b/services/cloudwatch/src/it/java/software/amazon/awssdk/services/cloudwatch/CloudWatchIntegrationTest.java @@ -35,9 +35,9 @@ import java.util.Collection; import java.util.LinkedList; import java.util.List; -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.StaticCredentialsProvider; import software.amazon.awssdk.core.SdkGlobalTime; import software.amazon.awssdk.core.exception.SdkServiceException; @@ -76,7 +76,7 @@ public class CloudWatchIntegrationTest extends AwsIntegrationTestBase { * Loads the AWS account info for the integration tests and creates a * CloudWatch client for tests to use. */ - @BeforeClass + @BeforeAll public static void setUp() throws IOException { cloudwatch = CloudWatchClient.builder() .credentialsProvider(getCredentialsProvider()) @@ -87,7 +87,7 @@ public static void setUp() throws IOException { /** * Cleans up any existing alarms before and after running the test suite */ - @AfterClass + @AfterAll public static void cleanupAlarms() { if (cloudwatch != null) { DescribeAlarmsResponse describeResult = cloudwatch.describeAlarms(DescribeAlarmsRequest.builder().build()); diff --git a/services/cloudwatchevents/src/it/java/software/amazon/awssdk/services/cloudwatchevents/CloudWatchEventsIntegrationTest.java b/services/cloudwatchevents/src/it/java/software/amazon/awssdk/services/cloudwatchevents/CloudWatchEventsIntegrationTest.java index e2b6e5ac7f4a..42a86aa9ff62 100644 --- a/services/cloudwatchevents/src/it/java/software/amazon/awssdk/services/cloudwatchevents/CloudWatchEventsIntegrationTest.java +++ b/services/cloudwatchevents/src/it/java/software/amazon/awssdk/services/cloudwatchevents/CloudWatchEventsIntegrationTest.java @@ -15,10 +15,10 @@ package software.amazon.awssdk.services.cloudwatchevents; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.cloudwatchevents.model.DeleteRuleRequest; import software.amazon.awssdk.services.cloudwatchevents.model.DescribeRuleRequest; import software.amazon.awssdk.services.cloudwatchevents.model.DescribeRuleResponse; @@ -36,7 +36,7 @@ public class CloudWatchEventsIntegrationTest extends AwsIntegrationTestBase { private static CloudWatchEventsClient events; - @BeforeClass + @BeforeAll public static void setUpClient() throws Exception { events = CloudWatchEventsClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); @@ -53,7 +53,7 @@ public static void setUpClient() throws Exception { .state()); } - @AfterClass + @AfterAll public static void tearDownAfterClass() throws Exception { events.deleteRule(DeleteRuleRequest.builder().name(RULE_NAME).build()); } diff --git a/services/cloudwatchlogs/src/it/java/software/amazon/awssdk/services/cloudwatchlogs/IntegrationTestBase.java b/services/cloudwatchlogs/src/it/java/software/amazon/awssdk/services/cloudwatchlogs/IntegrationTestBase.java index 346b39d16d7b..a01fe9668bf2 100644 --- a/services/cloudwatchlogs/src/it/java/software/amazon/awssdk/services/cloudwatchlogs/IntegrationTestBase.java +++ b/services/cloudwatchlogs/src/it/java/software/amazon/awssdk/services/cloudwatchlogs/IntegrationTestBase.java @@ -17,7 +17,7 @@ import java.io.FileNotFoundException; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.services.cloudwatchlogs.CloudWatchLogsClient; import software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsRequest; import software.amazon.awssdk.services.cloudwatchlogs.model.DescribeLogGroupsResponse; @@ -42,7 +42,7 @@ public abstract class IntegrationTestBase extends AwsIntegrationTestBase { * Loads the AWS account info for the integration tests and creates an CloudWatch Logs client * for tests to use. */ - @BeforeClass + @BeforeAll public static void setupFixture() throws FileNotFoundException, IOException { awsLogs = CloudWatchLogsClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); } diff --git a/services/cloudwatchlogs/src/it/java/software/amazon/awssdk/services/cloudwatchlogs/ServiceIntegrationTest.java b/services/cloudwatchlogs/src/it/java/software/amazon/awssdk/services/cloudwatchlogs/ServiceIntegrationTest.java index 673114705d5b..932286ead234 100644 --- a/services/cloudwatchlogs/src/it/java/software/amazon/awssdk/services/cloudwatchlogs/ServiceIntegrationTest.java +++ b/services/cloudwatchlogs/src/it/java/software/amazon/awssdk/services/cloudwatchlogs/ServiceIntegrationTest.java @@ -19,10 +19,10 @@ import java.io.IOException; import java.util.Map; -import org.junit.After; +import org.junit.jupiter.api.AfterEach; import org.junit.Assert; -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.exception.SdkServiceException; import software.amazon.awssdk.services.cloudwatchlogs.model.CreateLogGroupRequest; import software.amazon.awssdk.services.cloudwatchlogs.model.CreateLogStreamRequest; @@ -136,14 +136,14 @@ public static void testCreateLogStream(final String groupName, final String logS Assert.assertNull(createdStream.lastIngestionTime()); } - @Before + @BeforeEach public void setup() throws IOException { testCreateLogGroup(logGroupName); testCreateLogStream(logGroupName, logStreamName); testCreateMetricFilter(logGroupName, logMetricFilterName); } - @After + @AfterEach public void tearDown() { try { awsLogs.deleteLogStream(DeleteLogStreamRequest.builder().logGroupName(logGroupName).logStreamName(logStreamName).build()); diff --git a/services/codedeploy/src/it/java/software/amazon/awssdk/services/codedeploy/CodeDeployIntegrationTest.java b/services/codedeploy/src/it/java/software/amazon/awssdk/services/codedeploy/CodeDeployIntegrationTest.java index 5975dfa92aec..766740ef9c32 100644 --- a/services/codedeploy/src/it/java/software/amazon/awssdk/services/codedeploy/CodeDeployIntegrationTest.java +++ b/services/codedeploy/src/it/java/software/amazon/awssdk/services/codedeploy/CodeDeployIntegrationTest.java @@ -23,9 +23,9 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.List; -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.core.exception.SdkServiceException; import software.amazon.awssdk.services.codedeploy.model.ApplicationInfo; import software.amazon.awssdk.services.codedeploy.model.CreateApplicationRequest; @@ -61,7 +61,7 @@ public class CodeDeployIntegrationTest extends IntegrationTestBase { * Creates an application and asserts the result for the application id * returned from code deploy service. */ - @BeforeClass + @BeforeAll public static void setUp() throws FileNotFoundException, IOException { IntegrationTestBase.setUp(); CreateApplicationRequest createRequest = CreateApplicationRequest.builder() @@ -76,7 +76,7 @@ public static void setUp() throws FileNotFoundException, IOException { /** * Delete the application from code deploy service created for this testing. */ - @AfterClass + @AfterAll public static void tearDown() { if (applicationId != null) { codeDeploy.deleteApplication(DeleteApplicationRequest.builder() diff --git a/services/codedeploy/src/it/java/software/amazon/awssdk/services/codedeploy/IntegrationTestBase.java b/services/codedeploy/src/it/java/software/amazon/awssdk/services/codedeploy/IntegrationTestBase.java index c2577fb2b4c3..8688b2923f8f 100644 --- a/services/codedeploy/src/it/java/software/amazon/awssdk/services/codedeploy/IntegrationTestBase.java +++ b/services/codedeploy/src/it/java/software/amazon/awssdk/services/codedeploy/IntegrationTestBase.java @@ -17,7 +17,7 @@ import java.io.FileNotFoundException; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.testutils.service.AwsTestBase; public class IntegrationTestBase extends AwsTestBase { @@ -30,7 +30,7 @@ public class IntegrationTestBase extends AwsTestBase { /** * Reads the credentials and sets up the code deploy the client. */ - @BeforeClass + @BeforeAll public static void setUp() throws FileNotFoundException, IOException { setUpCredentials(); codeDeploy = CodeDeployClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); diff --git a/services/codepipeline/src/it/java/software/amazon/awssdk/services/codepipeline/AwsCodePipelineClientIntegrationTest.java b/services/codepipeline/src/it/java/software/amazon/awssdk/services/codepipeline/AwsCodePipelineClientIntegrationTest.java index 23cb6759befc..87d5e2a46693 100644 --- a/services/codepipeline/src/it/java/software/amazon/awssdk/services/codepipeline/AwsCodePipelineClientIntegrationTest.java +++ b/services/codepipeline/src/it/java/software/amazon/awssdk/services/codepipeline/AwsCodePipelineClientIntegrationTest.java @@ -20,8 +20,8 @@ import static org.junit.Assert.assertTrue; import java.util.List; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.codepipeline.model.ActionCategory; import software.amazon.awssdk.services.codepipeline.model.ActionOwner; import software.amazon.awssdk.services.codepipeline.model.ActionType; @@ -42,7 +42,7 @@ public class AwsCodePipelineClientIntegrationTest extends AwsTestBase { private static CodePipelineClient client; - @BeforeClass + @BeforeAll public static void setup() throws Exception { setUpCredentials(); client = CodePipelineClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); diff --git a/services/datapipeline/src/it/java/software/amazon/awssdk/services/datapipeline/DataPipelineIntegrationTest.java b/services/datapipeline/src/it/java/software/amazon/awssdk/services/datapipeline/DataPipelineIntegrationTest.java index a9db484c6a44..d3060387d129 100644 --- a/services/datapipeline/src/it/java/software/amazon/awssdk/services/datapipeline/DataPipelineIntegrationTest.java +++ b/services/datapipeline/src/it/java/software/amazon/awssdk/services/datapipeline/DataPipelineIntegrationTest.java @@ -21,8 +21,8 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import org.junit.AfterClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.exception.SdkServiceException; import software.amazon.awssdk.services.datapipeline.model.ActivatePipelineRequest; import software.amazon.awssdk.services.datapipeline.model.ActivatePipelineResponse; @@ -56,7 +56,7 @@ public class DataPipelineIntegrationTest extends IntegrationTestBase { private static final String FIELD_VALUE = "2012-09-25T17:00:00"; private static String pipelineId; - @AfterClass + @AfterAll public static void tearDown() { try { dataPipeline.deletePipeline(DeletePipelineRequest.builder().pipelineId(pipelineId).build()); diff --git a/services/datapipeline/src/it/java/software/amazon/awssdk/services/datapipeline/IntegrationTestBase.java b/services/datapipeline/src/it/java/software/amazon/awssdk/services/datapipeline/IntegrationTestBase.java index 755a091a716c..1dfabaf6713a 100644 --- a/services/datapipeline/src/it/java/software/amazon/awssdk/services/datapipeline/IntegrationTestBase.java +++ b/services/datapipeline/src/it/java/software/amazon/awssdk/services/datapipeline/IntegrationTestBase.java @@ -17,7 +17,7 @@ import java.io.FileNotFoundException; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.testutils.service.AwsTestBase; /** @@ -30,7 +30,7 @@ public class IntegrationTestBase extends AwsTestBase { /** The shared DP client for all tests to use. */ protected static DataPipelineClient dataPipeline; - @BeforeClass + @BeforeAll public static void setUp() throws FileNotFoundException, IOException { setUpCredentials(); diff --git a/services/directconnect/src/it/java/software/amazon/awssdk/services/directconnect/IntegrationTestBase.java b/services/directconnect/src/it/java/software/amazon/awssdk/services/directconnect/IntegrationTestBase.java index 0c3097a56254..8594b2ea3762 100644 --- a/services/directconnect/src/it/java/software/amazon/awssdk/services/directconnect/IntegrationTestBase.java +++ b/services/directconnect/src/it/java/software/amazon/awssdk/services/directconnect/IntegrationTestBase.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.services.directconnect; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.testutils.service.AwsTestBase; @@ -24,7 +24,7 @@ public class IntegrationTestBase extends AwsTestBase { protected static DirectConnectClient dc; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { setUpCredentials(); dc = DirectConnectClient.builder() diff --git a/services/directconnect/src/it/java/software/amazon/awssdk/services/directconnect/ServiceIntegrationTest.java b/services/directconnect/src/it/java/software/amazon/awssdk/services/directconnect/ServiceIntegrationTest.java index 29f58e3bf9cf..b1c58e658fdb 100644 --- a/services/directconnect/src/it/java/software/amazon/awssdk/services/directconnect/ServiceIntegrationTest.java +++ b/services/directconnect/src/it/java/software/amazon/awssdk/services/directconnect/ServiceIntegrationTest.java @@ -21,9 +21,9 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; -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.core.SdkGlobalTime; import software.amazon.awssdk.services.directconnect.model.CreateConnectionRequest; import software.amazon.awssdk.services.directconnect.model.CreateConnectionResponse; @@ -45,7 +45,7 @@ public class ServiceIntegrationTest extends IntegrationTestBase { private static String connectionId; - @BeforeClass + @BeforeAll public static void setup() { CreateConnectionResponse result = dc.createConnection(CreateConnectionRequest.builder() .connectionName(CONNECTION_NAME) @@ -55,7 +55,7 @@ public static void setup() { connectionId = result.connectionId(); } - @AfterClass + @AfterAll public static void tearDown() { boolean cleanedUp = Waiter.run(() -> dc.deleteConnection(r -> r.connectionId(connectionId))) diff --git a/services/directory/src/it/java/software/amazon/awssdk/services/directory/IntegrationTestBase.java b/services/directory/src/it/java/software/amazon/awssdk/services/directory/IntegrationTestBase.java index 3f99bc288418..c863cb592cf3 100644 --- a/services/directory/src/it/java/software/amazon/awssdk/services/directory/IntegrationTestBase.java +++ b/services/directory/src/it/java/software/amazon/awssdk/services/directory/IntegrationTestBase.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.services.directory; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.ec2.Ec2Client; import software.amazon.awssdk.testutils.service.AwsIntegrationTestBase; @@ -25,7 +25,7 @@ public class IntegrationTestBase extends AwsIntegrationTestBase { protected static DirectoryClient dsClient; protected static Ec2Client ec2Client; - @BeforeClass + @BeforeAll public static void baseSetupFixture() { dsClient = DirectoryClient.builder() .credentialsProvider(CREDENTIALS_PROVIDER_CHAIN) diff --git a/services/directory/src/it/java/software/amazon/awssdk/services/directory/ServiceIntegrationTest.java b/services/directory/src/it/java/software/amazon/awssdk/services/directory/ServiceIntegrationTest.java index 3e80fa88a814..91a596ef137a 100644 --- a/services/directory/src/it/java/software/amazon/awssdk/services/directory/ServiceIntegrationTest.java +++ b/services/directory/src/it/java/software/amazon/awssdk/services/directory/ServiceIntegrationTest.java @@ -19,7 +19,7 @@ import java.util.List; import junit.framework.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.directory.model.CreateDirectoryRequest; import software.amazon.awssdk.services.directory.model.DeleteDirectoryRequest; import software.amazon.awssdk.services.directory.model.DescribeDirectoriesRequest; diff --git a/services/docdb/src/test/java/software/amazon/awssdk/services/docdb/internal/PresignRequestHandlerTest.java b/services/docdb/src/test/java/software/amazon/awssdk/services/docdb/internal/PresignRequestHandlerTest.java index 1b240bdf446b..580e5359ace2 100644 --- a/services/docdb/src/test/java/software/amazon/awssdk/services/docdb/internal/PresignRequestHandlerTest.java +++ b/services/docdb/src/test/java/software/amazon/awssdk/services/docdb/internal/PresignRequestHandlerTest.java @@ -29,7 +29,7 @@ import java.util.GregorianCalendar; import java.util.TimeZone; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.signer.AwsSignerExecutionAttribute; diff --git a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/BaseResultIntegrationTest.java b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/BaseResultIntegrationTest.java index 9a952684b463..313295260d3e 100644 --- a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/BaseResultIntegrationTest.java +++ b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/BaseResultIntegrationTest.java @@ -17,8 +17,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.dynamodb.model.ListTablesRequest; import software.amazon.awssdk.services.dynamodb.model.ListTablesResponse; @@ -28,7 +28,7 @@ public class BaseResultIntegrationTest extends AwsIntegrationTestBase { private DynamoDbClient dynamoDB; - @Before + @BeforeEach public void setup() { dynamoDB = DynamoDbClient.builder() .region(Region.US_WEST_2) diff --git a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/DynamoDbJavaClientExceptionIntegrationTest.java b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/DynamoDbJavaClientExceptionIntegrationTest.java index 741c1253c34f..83925d529976 100644 --- a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/DynamoDbJavaClientExceptionIntegrationTest.java +++ b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/DynamoDbJavaClientExceptionIntegrationTest.java @@ -17,8 +17,8 @@ import java.util.UUID; import junit.framework.Assert; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.dynamodb.model.DescribeTableRequest; import software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException; import software.amazon.awssdk.testutils.service.AwsTestBase; @@ -30,7 +30,7 @@ public class DynamoDbJavaClientExceptionIntegrationTest extends AwsTestBase { private static DynamoDbClient ddb; - @BeforeClass + @BeforeAll public static void setup() throws Exception { setUpCredentials(); ddb = DynamoDbClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); diff --git a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/DynamoDbJavaClientRetryOnTimeoutIntegrationTest.java b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/DynamoDbJavaClientRetryOnTimeoutIntegrationTest.java index 163607d23e60..6fce7eafec0a 100644 --- a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/DynamoDbJavaClientRetryOnTimeoutIntegrationTest.java +++ b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/DynamoDbJavaClientRetryOnTimeoutIntegrationTest.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.services.dynamodb; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; import software.amazon.awssdk.core.exception.ApiCallAttemptTimeoutException; import software.amazon.awssdk.core.retry.RetryPolicy; diff --git a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/SecurityManagerIntegrationTest.java b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/SecurityManagerIntegrationTest.java index f0b55bced2e1..a189cf3cabe0 100644 --- a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/SecurityManagerIntegrationTest.java +++ b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/SecurityManagerIntegrationTest.java @@ -17,8 +17,8 @@ import static org.junit.Assert.assertNotNull; -import org.junit.AfterClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.dynamodb.model.ListTablesRequest; import software.amazon.awssdk.testutils.service.AwsIntegrationTestBase; @@ -26,7 +26,7 @@ public class SecurityManagerIntegrationTest extends AwsIntegrationTestBase { private static final String JAVA_SECURITY_POLICY_PROPERTY = "java.security.policy"; - @AfterClass + @AfterAll public static void tearDownFixture() { System.setSecurityManager(null); System.clearProperty(JAVA_SECURITY_POLICY_PROPERTY); diff --git a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/SignersIntegrationTest.java b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/SignersIntegrationTest.java index e933e6b4f30c..62ff37014e33 100644 --- a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/SignersIntegrationTest.java +++ b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/SignersIntegrationTest.java @@ -23,9 +23,9 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -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.AwsCredentials; import software.amazon.awssdk.auth.signer.Aws4Signer; import software.amazon.awssdk.auth.signer.AwsSignerExecutionAttribute; @@ -66,7 +66,7 @@ public class SignersIntegrationTest extends DynamoDBTestBase { private static final AwsCredentials awsCredentials = CREDENTIALS_PROVIDER_CHAIN.resolveCredentials(); private static final String SIGNING_NAME = "dynamodb"; - @BeforeClass + @BeforeAll public static void setUpFixture() throws Exception { DynamoDBTestBase.setUpTestBase(); @@ -96,7 +96,7 @@ private static void putTestData() { dynamo.putItem(PutItemRequest.builder().tableName(TABLE_NAME).item(item).build()); } - @AfterClass + @AfterAll public static void cleanUpFixture() { boolean deleteWorked = Waiter.run(() -> dynamo.deleteTable(r -> r.tableName(TABLE_NAME))) diff --git a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/WaitersIntegrationTest.java b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/WaitersIntegrationTest.java index e416b4657dc1..11979c1c1e64 100644 --- a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/WaitersIntegrationTest.java +++ b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/WaitersIntegrationTest.java @@ -19,9 +19,9 @@ import java.util.concurrent.CompletableFuture; import org.assertj.core.api.Condition; -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.core.waiters.WaiterResponse; import software.amazon.awssdk.services.dynamodb.model.AttributeDefinition; import software.amazon.awssdk.services.dynamodb.model.CreateTableRequest; @@ -44,7 +44,7 @@ public class WaitersIntegrationTest extends DynamoDBTestBase { private static final String HASH_KEY_NAME = BasicTempTable.HASH_KEY_NAME; private static DynamoDbAsyncClient dynamoAsync; - @BeforeClass + @BeforeAll public static void setUp() { DynamoDBTestBase.setUpTestBase(); @@ -65,7 +65,7 @@ public static void setUp() { .build()); } - @AfterClass + @AfterAll public static void cleanUp() { dynamoAsync.deleteTable(DeleteTableRequest.builder().tableName(TABLE_NAME).build()); diff --git a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/streams/StreamsIntegrationTest.java b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/streams/StreamsIntegrationTest.java index d4858abb08d2..a8f9c752ad56 100644 --- a/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/streams/StreamsIntegrationTest.java +++ b/services/dynamodb/src/it/java/software/amazon/awssdk/services/dynamodb/streams/StreamsIntegrationTest.java @@ -15,8 +15,8 @@ package software.amazon.awssdk.services.dynamodb.streams; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.dynamodb.model.ListStreamsRequest; import software.amazon.awssdk.testutils.service.AwsTestBase; @@ -24,7 +24,7 @@ public class StreamsIntegrationTest extends AwsTestBase { private DynamoDbStreamsClient streams; - @Before + @BeforeEach public void setup() throws Exception { setUpCredentials(); streams = DynamoDbStreamsClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); diff --git a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/DynamoDbRetryPolicyTest.java b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/DynamoDbRetryPolicyTest.java index e712db0c02fd..c99de392ed52 100644 --- a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/DynamoDbRetryPolicyTest.java +++ b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/DynamoDbRetryPolicyTest.java @@ -3,9 +3,9 @@ import static org.assertj.core.api.Assertions.assertThat; import java.time.Duration; -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 software.amazon.awssdk.core.SdkSystemSetting; import software.amazon.awssdk.core.client.config.SdkClientConfiguration; import software.amazon.awssdk.core.retry.RetryPolicy; @@ -17,12 +17,12 @@ public class DynamoDbRetryPolicyTest { private EnvironmentVariableHelper environmentVariableHelper; - @Before + @BeforeEach public void setup() { environmentVariableHelper = new EnvironmentVariableHelper(); } - @After + @AfterEach public void reset() { environmentVariableHelper.reset(); } diff --git a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/EmptyAttributeTest.java b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/EmptyAttributeTest.java index eeee13ceeff7..c76aaec0f218 100644 --- a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/EmptyAttributeTest.java +++ b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/EmptyAttributeTest.java @@ -27,9 +27,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; import java.util.Collections; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.SdkBytes; @@ -54,7 +54,7 @@ public class EmptyAttributeTest { private DynamoDbStreamsClient dynamoDbStreamsClient; private DynamoDbStreamsAsyncClient dynamoDbStreamsAsyncClient; - @Before + @BeforeEach public void setup() { dynamoDbClient = DynamoDbClient.builder() diff --git a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/GlobalRequestHandlerTest.java b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/GlobalRequestHandlerTest.java index e9a05226f543..f01a17ca6369 100644 --- a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/GlobalRequestHandlerTest.java +++ b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/GlobalRequestHandlerTest.java @@ -18,8 +18,8 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; -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.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.exception.SdkException; @@ -29,7 +29,7 @@ public class GlobalRequestHandlerTest { - @Before + @BeforeEach public void setup() { TestGlobalExecutionInterceptor.reset(); } diff --git a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/PaginatorInUserAgentTest.java b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/PaginatorInUserAgentTest.java index 3e5ce2ea94ca..561fe5a4185f 100644 --- a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/PaginatorInUserAgentTest.java +++ b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/PaginatorInUserAgentTest.java @@ -26,9 +26,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.io.IOException; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.util.VersionInfo; @@ -43,7 +43,7 @@ public class PaginatorInUserAgentTest { private DynamoDbClient dynamoDbClient; private DynamoDbAsyncClient dynamoDbAsyncClient; - @Before + @BeforeEach public void setup() { dynamoDbClient = DynamoDbClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("test", diff --git a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/PutItemRequestMarshallerTest.java b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/PutItemRequestMarshallerTest.java index ef288dfa569d..b4015e70bdb7 100644 --- a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/PutItemRequestMarshallerTest.java +++ b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/PutItemRequestMarshallerTest.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.net.URI; import java.nio.ByteBuffer; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.core.client.config.SdkClientConfiguration; import software.amazon.awssdk.core.client.config.SdkClientOption; diff --git a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/WaitersUserAgentTest.java b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/WaitersUserAgentTest.java index 5f59cd8e2ada..a511052a0922 100644 --- a/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/WaitersUserAgentTest.java +++ b/services/dynamodb/src/test/java/software/amazon/awssdk/services/dynamodb/WaitersUserAgentTest.java @@ -22,15 +22,14 @@ import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.times; import com.github.tomakehurst.wiremock.common.ConsoleNotifier; import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; import java.util.concurrent.CompletableFuture; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Matchers; import org.mockito.Mockito; @@ -55,7 +54,7 @@ public class WaitersUserAgentTest { private DynamoDbAsyncClient dynamoDbAsyncClient; private ExecutionInterceptor interceptor; - @Before + @BeforeEach public void setup() { interceptor = Mockito.spy(AbstractExecutionInterceptor.class); diff --git a/services/dynamodb/src/test/java/utils/resources/ResourceCentricBlockJUnit4ClassRunner.java b/services/dynamodb/src/test/java/utils/resources/ResourceCentricBlockJUnit4ClassRunner.java index 79cc0f82214a..d1c20e11ffb9 100644 --- a/services/dynamodb/src/test/java/utils/resources/ResourceCentricBlockJUnit4ClassRunner.java +++ b/services/dynamodb/src/test/java/utils/resources/ResourceCentricBlockJUnit4ClassRunner.java @@ -17,7 +17,7 @@ import java.util.HashSet; import java.util.Set; -import org.junit.Ignore; +import org.junit.jupiter.api.Disabled; import org.junit.runner.Description; import org.junit.runner.notification.Failure; import org.junit.runner.notification.RunNotifier; @@ -62,7 +62,7 @@ private static TestResource createResourceInstance(RequiredResource resourceAnno @Override protected void runChild(final FrameworkMethod method, RunNotifier notifier) { Description description = describeChild(method); - if (method.getAnnotation(Ignore.class) != null) { + if (method.getAnnotation(Disabled.class) != null) { notifier.fireTestIgnored(description); } else { RequiredResources annotation = method.getAnnotation(RequiredResources.class); diff --git a/services/dynamodb/src/test/java/utils/test/util/DynamoDBIntegrationTestBase.java b/services/dynamodb/src/test/java/utils/test/util/DynamoDBIntegrationTestBase.java index 0adff9b7ffaf..11b77212b6be 100644 --- a/services/dynamodb/src/test/java/utils/test/util/DynamoDBIntegrationTestBase.java +++ b/services/dynamodb/src/test/java/utils/test/util/DynamoDBIntegrationTestBase.java @@ -15,7 +15,7 @@ package utils.test.util; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.dynamodb.DynamoDbClient; import software.amazon.awssdk.services.dynamodb.model.AttributeDefinition; @@ -39,7 +39,7 @@ public class DynamoDBIntegrationTestBase extends DynamoDBTestBase { protected static final String TABLE_WITH_INDEX_RANGE_ATTRIBUTE = "aws-java-sdk-index-range-test"; protected static long startKey = System.currentTimeMillis(); - @BeforeClass + @BeforeAll public static void setUp() throws Exception { setUpCredentials(); dynamo = DynamoDbClient.builder().region(Region.US_EAST_1).credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); diff --git a/services/ec2/src/test/java/software/amazon/awssdk/services/ec2/Ec2AutoPaginatorIntegrationTest.java b/services/ec2/src/test/java/software/amazon/awssdk/services/ec2/Ec2AutoPaginatorIntegrationTest.java index 292b3008a004..0bbea74f4857 100644 --- a/services/ec2/src/test/java/software/amazon/awssdk/services/ec2/Ec2AutoPaginatorIntegrationTest.java +++ b/services/ec2/src/test/java/software/amazon/awssdk/services/ec2/Ec2AutoPaginatorIntegrationTest.java @@ -19,7 +19,7 @@ import java.time.Instant; import java.util.stream.Stream; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.ec2.model.SpotPrice; import software.amazon.awssdk.services.ec2.paginators.DescribeSpotPriceHistoryPublisher; diff --git a/services/ec2/src/test/java/software/amazon/awssdk/services/ec2/Ec2ResponseMetadataIntegrationTest.java b/services/ec2/src/test/java/software/amazon/awssdk/services/ec2/Ec2ResponseMetadataIntegrationTest.java index 12bb0b420299..ac6945e93011 100644 --- a/services/ec2/src/test/java/software/amazon/awssdk/services/ec2/Ec2ResponseMetadataIntegrationTest.java +++ b/services/ec2/src/test/java/software/amazon/awssdk/services/ec2/Ec2ResponseMetadataIntegrationTest.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.services.ec2.model.DescribeAvailabilityZonesResponse; import software.amazon.awssdk.testutils.service.AwsIntegrationTestBase; diff --git a/services/ecr/src/it/java/software/amazon/awssdk/services/ecr/EcrIntegrationTest.java b/services/ecr/src/it/java/software/amazon/awssdk/services/ecr/EcrIntegrationTest.java index 1d3d08684012..79448a464e38 100644 --- a/services/ecr/src/it/java/software/amazon/awssdk/services/ecr/EcrIntegrationTest.java +++ b/services/ecr/src/it/java/software/amazon/awssdk/services/ecr/EcrIntegrationTest.java @@ -16,9 +16,9 @@ package software.amazon.awssdk.services.ecr; import junit.framework.Assert; -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.services.ecr.model.CreateRepositoryRequest; import software.amazon.awssdk.services.ecr.model.CreateRepositoryResponse; import software.amazon.awssdk.services.ecr.model.DeleteRepositoryRequest; @@ -31,12 +31,12 @@ public class EcrIntegrationTest extends AwsIntegrationTestBase { private static final String REPO_NAME = "java-sdk-test-repo-" + System.currentTimeMillis(); private static EcrClient ecr; - @BeforeClass + @BeforeAll public static void setUpClient() throws Exception { ecr = EcrClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); } - @AfterClass + @AfterAll public static void tearDownAfterClass() throws Exception { if (ecr != null) { ecr.deleteRepository(DeleteRepositoryRequest.builder() diff --git a/services/ecs/src/it/java/software/amazon/awssdk/services/ecs/EC2ContainerServiceIntegrationTest.java b/services/ecs/src/it/java/software/amazon/awssdk/services/ecs/EC2ContainerServiceIntegrationTest.java index 991709b04d31..3d071c4d5b4d 100644 --- a/services/ecs/src/it/java/software/amazon/awssdk/services/ecs/EC2ContainerServiceIntegrationTest.java +++ b/services/ecs/src/it/java/software/amazon/awssdk/services/ecs/EC2ContainerServiceIntegrationTest.java @@ -17,10 +17,10 @@ import java.util.Arrays; import java.util.List; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.ecs.model.ContainerDefinition; import software.amazon.awssdk.services.ecs.model.CreateClusterRequest; import software.amazon.awssdk.services.ecs.model.CreateClusterResponse; @@ -41,7 +41,7 @@ public class EC2ContainerServiceIntegrationTest extends AwsTestBase { private static EcsClient client; private static String clusterArn; - @BeforeClass + @BeforeAll public static void setup() throws Exception { setUpCredentials(); @@ -62,7 +62,7 @@ public static void setup() throws Exception { .orFail(); } - @AfterClass + @AfterAll public static void cleanup() { if (client != null) { client.deleteCluster(DeleteClusterRequest.builder().cluster(CLUSTER_NAME).build()); diff --git a/services/efs/src/it/java/software/amazon/awssdk/services/efs/ElasticFileSystemIntegrationTest.java b/services/efs/src/it/java/software/amazon/awssdk/services/efs/ElasticFileSystemIntegrationTest.java index 640f63fd945e..45a30381b70c 100644 --- a/services/efs/src/it/java/software/amazon/awssdk/services/efs/ElasticFileSystemIntegrationTest.java +++ b/services/efs/src/it/java/software/amazon/awssdk/services/efs/ElasticFileSystemIntegrationTest.java @@ -19,9 +19,9 @@ import static org.junit.Assert.assertNotNull; import java.util.UUID; -import org.junit.After; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.efs.model.CreateFileSystemRequest; import software.amazon.awssdk.services.efs.model.DeleteFileSystemRequest; @@ -36,12 +36,12 @@ public class ElasticFileSystemIntegrationTest extends AwsIntegrationTestBase { private static EfsClient client; private String fileSystemId; - @BeforeClass + @BeforeAll public static void setupFixture() throws Exception { client = EfsClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).region(Region.US_WEST_2).build(); } - @After + @AfterEach public void tearDown() { if (!StringUtils.isEmpty(fileSystemId)) { client.deleteFileSystem(DeleteFileSystemRequest.builder().fileSystemId(fileSystemId).build()); diff --git a/services/elasticache/src/it/java/software/amazon/awssdk/services/elasticache/ElastiCacheIntegrationTestBase.java b/services/elasticache/src/it/java/software/amazon/awssdk/services/elasticache/ElastiCacheIntegrationTestBase.java index fe9f93eb2087..40120f05a61f 100644 --- a/services/elasticache/src/it/java/software/amazon/awssdk/services/elasticache/ElastiCacheIntegrationTestBase.java +++ b/services/elasticache/src/it/java/software/amazon/awssdk/services/elasticache/ElastiCacheIntegrationTestBase.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.services.elasticache; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.testutils.service.AwsTestBase; public class ElastiCacheIntegrationTestBase extends AwsTestBase { @@ -25,7 +25,7 @@ public class ElastiCacheIntegrationTestBase extends AwsTestBase { protected static ElastiCacheClient elasticache; - @BeforeClass + @BeforeAll public static void setUp() throws Exception { setUpCredentials(); elasticache = ElastiCacheClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); diff --git a/services/elasticache/src/it/java/software/amazon/awssdk/services/elasticache/ParameterGroupsIntegrationTest.java b/services/elasticache/src/it/java/software/amazon/awssdk/services/elasticache/ParameterGroupsIntegrationTest.java index a77d3a5c54f5..3018ebe041e5 100644 --- a/services/elasticache/src/it/java/software/amazon/awssdk/services/elasticache/ParameterGroupsIntegrationTest.java +++ b/services/elasticache/src/it/java/software/amazon/awssdk/services/elasticache/ParameterGroupsIntegrationTest.java @@ -21,8 +21,8 @@ import java.util.ArrayList; import java.util.List; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.elasticache.model.CacheNodeTypeSpecificParameter; import software.amazon.awssdk.services.elasticache.model.CacheParameterGroup; import software.amazon.awssdk.services.elasticache.model.CreateCacheParameterGroupRequest; @@ -48,7 +48,7 @@ public class ParameterGroupsIntegrationTest extends ElastiCacheIntegrationTestBa private String cacheParameterGroupName; /** Releases all resources created by tests. */ - @After + @AfterEach public void tearDown() throws Exception { if (cacheParameterGroupName != null) { try { diff --git a/services/elasticbeanstalk/src/it/java/software/amazon/awssdk/services/elasticbeanstalk/ElasticBeanstalkIntegrationTest.java b/services/elasticbeanstalk/src/it/java/software/amazon/awssdk/services/elasticbeanstalk/ElasticBeanstalkIntegrationTest.java index fdda9c221be3..19a10cf0100a 100644 --- a/services/elasticbeanstalk/src/it/java/software/amazon/awssdk/services/elasticbeanstalk/ElasticBeanstalkIntegrationTest.java +++ b/services/elasticbeanstalk/src/it/java/software/amazon/awssdk/services/elasticbeanstalk/ElasticBeanstalkIntegrationTest.java @@ -20,7 +20,7 @@ import static software.amazon.awssdk.testutils.SdkAsserts.assertNotEmpty; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.elasticbeanstalk.model.ListAvailableSolutionStacksRequest; /** diff --git a/services/elasticbeanstalk/src/it/java/software/amazon/awssdk/services/elasticbeanstalk/ElasticBeanstalkIntegrationTestBase.java b/services/elasticbeanstalk/src/it/java/software/amazon/awssdk/services/elasticbeanstalk/ElasticBeanstalkIntegrationTestBase.java index df8e0a82387a..a3b2d5e14db8 100644 --- a/services/elasticbeanstalk/src/it/java/software/amazon/awssdk/services/elasticbeanstalk/ElasticBeanstalkIntegrationTestBase.java +++ b/services/elasticbeanstalk/src/it/java/software/amazon/awssdk/services/elasticbeanstalk/ElasticBeanstalkIntegrationTestBase.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.services.elasticbeanstalk; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.testutils.service.AwsTestBase; /** @@ -30,7 +30,7 @@ public abstract class ElasticBeanstalkIntegrationTestBase extends AwsTestBase { /** * Loads the AWS account info for the integration tests and creates an clients for tests to use. */ - @BeforeClass + @BeforeAll public static void setUp() throws IOException { setUpCredentials(); diff --git a/services/elasticloadbalancing/src/it/java/software/amazon/awssdk/services/elasticloadbalancing/ElbIntegrationTest.java b/services/elasticloadbalancing/src/it/java/software/amazon/awssdk/services/elasticloadbalancing/ElbIntegrationTest.java index 71c93a78fcd6..273df49a0d95 100644 --- a/services/elasticloadbalancing/src/it/java/software/amazon/awssdk/services/elasticloadbalancing/ElbIntegrationTest.java +++ b/services/elasticloadbalancing/src/it/java/software/amazon/awssdk/services/elasticloadbalancing/ElbIntegrationTest.java @@ -27,10 +27,10 @@ import java.io.IOException; import java.time.Duration; import java.util.List; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.ec2.Ec2Client; import software.amazon.awssdk.services.ec2.model.DescribeImagesRequest; @@ -121,7 +121,7 @@ public class ElbIntegrationTest extends AwsIntegrationTestBase { * Loads the AWS account info for the integration tests and creates an EC2 * client for tests to use. */ - @BeforeClass + @BeforeAll public static void setUp() throws IOException { elb = ElasticLoadBalancingClient.builder() .credentialsProvider(CREDENTIALS_PROVIDER_CHAIN) @@ -146,7 +146,7 @@ public static void setUp() throws IOException { /** * Create LoadBalancer resource before each unit test */ - @Before + @BeforeEach public void createDefaultLoadBalancer() { loadBalancerName = "integ-test-lb-" + System.currentTimeMillis(); Listener expectedListener = Listener.builder().instancePort(8080) @@ -165,7 +165,7 @@ public void createDefaultLoadBalancer() { } /** Release any resources created by this test. */ - @After + @AfterEach public void tearDown() throws Exception { if (loadBalancerName != null) { try { diff --git a/services/elasticsearch/src/it/java/software/amazon/awssdk/services/elasticsearch/ServiceIntegrationTest.java b/services/elasticsearch/src/it/java/software/amazon/awssdk/services/elasticsearch/ServiceIntegrationTest.java index 9a960a29d3fe..b961d67beec6 100644 --- a/services/elasticsearch/src/it/java/software/amazon/awssdk/services/elasticsearch/ServiceIntegrationTest.java +++ b/services/elasticsearch/src/it/java/software/amazon/awssdk/services/elasticsearch/ServiceIntegrationTest.java @@ -25,9 +25,9 @@ import java.util.Collection; import java.util.LinkedList; import java.util.List; -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.services.elasticsearch.model.AddTagsRequest; import software.amazon.awssdk.services.elasticsearch.model.CreateElasticsearchDomainRequest; import software.amazon.awssdk.services.elasticsearch.model.DeleteElasticsearchDomainRequest; @@ -51,13 +51,13 @@ public class ServiceIntegrationTest extends AwsTestBase { private static final String DOMAIN_NAME = "java-es-test-" + System.currentTimeMillis(); - @BeforeClass + @BeforeAll public static void setup() throws IOException { setUpCredentials(); es = ElasticsearchClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); } - @AfterClass + @AfterAll public static void tearDown() { es.deleteElasticsearchDomain(DeleteElasticsearchDomainRequest.builder().domainName(DOMAIN_NAME).build()); } diff --git a/services/emr/src/it/java/software/amazon/awssdk/services/emr/EMRIntegrationTest.java b/services/emr/src/it/java/software/amazon/awssdk/services/emr/EMRIntegrationTest.java index a2771e9c531a..1b063cb06107 100644 --- a/services/emr/src/it/java/software/amazon/awssdk/services/emr/EMRIntegrationTest.java +++ b/services/emr/src/it/java/software/amazon/awssdk/services/emr/EMRIntegrationTest.java @@ -17,8 +17,8 @@ import java.time.Duration; import java.time.Instant; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.emr.model.ListClustersRequest; import software.amazon.awssdk.services.emr.model.TerminateJobFlowsRequest; @@ -31,7 +31,7 @@ public class EMRIntegrationTest extends IntegrationTestBase { /** * Cleans up any created tests resources. */ - @After + @AfterEach public void tearDown() throws Exception { try { if (jobFlowId != null) { diff --git a/services/emr/src/it/java/software/amazon/awssdk/services/emr/IntegrationTestBase.java b/services/emr/src/it/java/software/amazon/awssdk/services/emr/IntegrationTestBase.java index f11fa56af4c0..d89261c925fe 100644 --- a/services/emr/src/it/java/software/amazon/awssdk/services/emr/IntegrationTestBase.java +++ b/services/emr/src/it/java/software/amazon/awssdk/services/emr/IntegrationTestBase.java @@ -17,7 +17,7 @@ import java.io.FileNotFoundException; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.testutils.service.AwsTestBase; /** @@ -34,7 +34,7 @@ public class IntegrationTestBase extends AwsTestBase { * Loads the AWS account info for the integration tests and creates an * EMR client for tests to use. */ - @BeforeClass + @BeforeAll public static void setUp() throws FileNotFoundException, IOException { setUpCredentials(); emr = EmrClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); diff --git a/services/firehose/src/it/java/software/amazon/awssdk/services/firehose/ServiceIntegrationTest.java b/services/firehose/src/it/java/software/amazon/awssdk/services/firehose/ServiceIntegrationTest.java index 95277110d059..26ea18ac7346 100644 --- a/services/firehose/src/it/java/software/amazon/awssdk/services/firehose/ServiceIntegrationTest.java +++ b/services/firehose/src/it/java/software/amazon/awssdk/services/firehose/ServiceIntegrationTest.java @@ -23,10 +23,9 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.List; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.awscore.exception.AwsServiceException; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.services.firehose.model.CreateDeliveryStreamRequest; @@ -50,7 +49,7 @@ public class ServiceIntegrationTest extends AwsTestBase { private static FirehoseClient firehose; - @BeforeClass + @BeforeAll public static void setup() throws FileNotFoundException, IOException { // setUpCredentials(); // firehose = new AmazonKinesisFirehoseClient(credentials); @@ -61,7 +60,7 @@ public static void setup() throws FileNotFoundException, IOException { firehose = FirehoseClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); } - @AfterClass + @AfterAll public static void tearDown() { // firehose.deleteDeliveryStream(new DeleteDeliveryStreamRequest() // .withDeliveryStreamName(DEVLIVERY_STREAM_NAME)); diff --git a/services/gamelift/src/it/java/software/amazon/awssdk/services/gamelift/ServiceIntegrationTest.java b/services/gamelift/src/it/java/software/amazon/awssdk/services/gamelift/ServiceIntegrationTest.java index 3072603c91c2..902218d035a7 100644 --- a/services/gamelift/src/it/java/software/amazon/awssdk/services/gamelift/ServiceIntegrationTest.java +++ b/services/gamelift/src/it/java/software/amazon/awssdk/services/gamelift/ServiceIntegrationTest.java @@ -16,10 +16,10 @@ package software.amazon.awssdk.services.gamelift; import java.io.IOException; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.gamelift.model.Alias; import software.amazon.awssdk.services.gamelift.model.CreateAliasRequest; import software.amazon.awssdk.services.gamelift.model.CreateAliasResponse; @@ -36,12 +36,12 @@ public class ServiceIntegrationTest extends AwsIntegrationTestBase { private static String aliasId = null; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { gameLift = GameLiftClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); } - @AfterClass + @AfterAll public static void cleanUp() { if (aliasId != null) { gameLift.deleteAlias(DeleteAliasRequest.builder().aliasId(aliasId).build()); diff --git a/services/glacier/src/it/java/software/amazon/awssdk/services/glacier/ServiceIntegrationTest.java b/services/glacier/src/it/java/software/amazon/awssdk/services/glacier/ServiceIntegrationTest.java index b952809005f1..91434d7aa55e 100644 --- a/services/glacier/src/it/java/software/amazon/awssdk/services/glacier/ServiceIntegrationTest.java +++ b/services/glacier/src/it/java/software/amazon/awssdk/services/glacier/ServiceIntegrationTest.java @@ -19,8 +19,8 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import org.assertj.core.api.Condition; -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.client.config.ClientOverrideConfiguration; import software.amazon.awssdk.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; @@ -36,7 +36,7 @@ public class ServiceIntegrationTest extends AwsIntegrationTestBase { private CapturingExecutionInterceptor capturingExecutionInterceptor = new CapturingExecutionInterceptor(); - @Before + @BeforeEach public void setup() { client = GlacierClient.builder() .credentialsProvider(getCredentialsProvider()) diff --git a/services/glacier/src/it/java/software/amazon/awssdk/services/glacier/UploadArchiveIntegrationTest.java b/services/glacier/src/it/java/software/amazon/awssdk/services/glacier/UploadArchiveIntegrationTest.java index 4597c0d996c3..bfe20a28effb 100644 --- a/services/glacier/src/it/java/software/amazon/awssdk/services/glacier/UploadArchiveIntegrationTest.java +++ b/services/glacier/src/it/java/software/amazon/awssdk/services/glacier/UploadArchiveIntegrationTest.java @@ -18,10 +18,10 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.async.AsyncRequestBody; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.glacier.model.UploadArchiveRequest; @@ -34,7 +34,7 @@ public class UploadArchiveIntegrationTest extends AwsIntegrationTestBase { private static final List CREATED_ARCHIVES = new ArrayList<>(); private static GlacierAsyncClient asyncClient; - @BeforeClass + @BeforeAll public static void setup() { asyncClient = GlacierAsyncClient.builder() .credentialsProvider(getCredentialsProvider()) @@ -49,7 +49,7 @@ public static void setup() { } } - @AfterClass + @AfterAll // Vault deletion takes at least 24 hours since that's how often Glacier does an inventory and you cannot // delete a vault if a vault has been written to since the last inventory! public static void teardown() { @@ -64,7 +64,7 @@ public static void teardown() { } @Test - @Ignore + @Disabled public void test_uploadArchive_succeeds() { byte[] contents = "Hello Glacier".getBytes(StandardCharsets.UTF_8); // echo -n "Hello Glacier" | shasum -a 256 diff --git a/services/glacier/src/test/java/software/amazon/awssdk/services/glacier/AccountIdDefaultValueTest.java b/services/glacier/src/test/java/software/amazon/awssdk/services/glacier/AccountIdDefaultValueTest.java index ae90ad624162..e0997e0a0b86 100644 --- a/services/glacier/src/test/java/software/amazon/awssdk/services/glacier/AccountIdDefaultValueTest.java +++ b/services/glacier/src/test/java/software/amazon/awssdk/services/glacier/AccountIdDefaultValueTest.java @@ -25,9 +25,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; @@ -43,7 +43,7 @@ public class AccountIdDefaultValueTest { private GlacierClient glacier; - @Before + @BeforeEach public void setup() { glacier = GlacierClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/services/glacier/src/test/java/software/amazon/awssdk/services/glacier/UploadArchiveHeaderTest.java b/services/glacier/src/test/java/software/amazon/awssdk/services/glacier/UploadArchiveHeaderTest.java index 6786273f3811..97d35b12a69d 100644 --- a/services/glacier/src/test/java/software/amazon/awssdk/services/glacier/UploadArchiveHeaderTest.java +++ b/services/glacier/src/test/java/software/amazon/awssdk/services/glacier/UploadArchiveHeaderTest.java @@ -29,9 +29,9 @@ import java.io.File; import java.io.IOException; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.sync.RequestBody; @@ -49,7 +49,7 @@ public class UploadArchiveHeaderTest { private UploadArchiveRequest request; - @Before + @BeforeEach public void setup() { glacier = GlacierClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/services/iam/src/it/java/software/amazon/awssdk/services/iam/ServiceIntegrationTest.java b/services/iam/src/it/java/software/amazon/awssdk/services/iam/ServiceIntegrationTest.java index dfd86831359d..d2e5a974b5cf 100644 --- a/services/iam/src/it/java/software/amazon/awssdk/services/iam/ServiceIntegrationTest.java +++ b/services/iam/src/it/java/software/amazon/awssdk/services/iam/ServiceIntegrationTest.java @@ -17,8 +17,8 @@ import static org.assertj.core.api.Assertions.assertThat; -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.retry.RetryPolicy; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.testutils.service.AwsTestBase; @@ -26,7 +26,7 @@ public class ServiceIntegrationTest extends AwsTestBase { protected IamClient iam; - @Before + @BeforeEach public void setUp() { iam = IamClient.builder() .credentialsProvider(CREDENTIALS_PROVIDER_CHAIN) diff --git a/services/inspector/src/test/java/software/amazon/awssdk/services/inspector/InspectorErrorUnmarshallingTest.java b/services/inspector/src/test/java/software/amazon/awssdk/services/inspector/InspectorErrorUnmarshallingTest.java index 9425629b2084..d7882e0653d8 100644 --- a/services/inspector/src/test/java/software/amazon/awssdk/services/inspector/InspectorErrorUnmarshallingTest.java +++ b/services/inspector/src/test/java/software/amazon/awssdk/services/inspector/InspectorErrorUnmarshallingTest.java @@ -36,9 +36,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.exception.SdkServiceException; @@ -53,7 +53,7 @@ public class InspectorErrorUnmarshallingTest { private InspectorClient inspector; - @Before + @BeforeEach public void setup() { StaticCredentialsProvider credsProvider = StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid")); inspector = InspectorClient.builder() diff --git a/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/AbstractTestCase.java b/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/AbstractTestCase.java index 85a23f5ab49b..c73d02ecd33a 100644 --- a/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/AbstractTestCase.java +++ b/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/AbstractTestCase.java @@ -20,7 +20,7 @@ import java.io.IOException; import java.net.URI; import java.util.Properties; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.awscore.util.AwsHostNameUtils; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.testutils.service.AwsTestBase; @@ -29,7 +29,7 @@ public class AbstractTestCase extends AwsTestBase { protected static KinesisClient client; protected static KinesisAsyncClient asyncClient; - @BeforeClass + @BeforeAll public static void init() throws IOException { setUpCredentials(); KinesisClientBuilder builder = KinesisClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN); diff --git a/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/KinesisIntegrationTests.java b/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/KinesisIntegrationTests.java index a5691835ad5b..98aed6264ee2 100644 --- a/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/KinesisIntegrationTests.java +++ b/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/KinesisIntegrationTests.java @@ -23,8 +23,8 @@ import java.util.List; import org.hamcrest.Matchers; import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.core.exception.SdkServiceException; import software.amazon.awssdk.services.kinesis.model.CreateStreamRequest; @@ -109,7 +109,7 @@ public void testGetFromBogusIterator() { } @Test - @Ignore + @Disabled public void testKinesisOperations() throws Exception { String streamName = "java-test-stream-" + System.currentTimeMillis(); boolean created = false; diff --git a/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/KinesisResponseMetadataIntegrationTest.java b/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/KinesisResponseMetadataIntegrationTest.java index 7f835f6980eb..6c7a4f548b3d 100644 --- a/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/KinesisResponseMetadataIntegrationTest.java +++ b/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/KinesisResponseMetadataIntegrationTest.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.services.kinesis.model.DescribeLimitsResponse; import software.amazon.awssdk.services.kinesis.model.KinesisResponse; diff --git a/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/SubscribeToShardIntegrationTest.java b/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/SubscribeToShardIntegrationTest.java index d3171bf3744d..a293ecf052a1 100644 --- a/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/SubscribeToShardIntegrationTest.java +++ b/services/kinesis/src/it/java/software/amazon/awssdk/services/kinesis/SubscribeToShardIntegrationTest.java @@ -30,9 +30,9 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import org.apache.commons.lang3.RandomUtils; -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.SdkBytes; @@ -59,7 +59,7 @@ public class SubscribeToShardIntegrationTest extends AbstractTestCase { private static String consumerArn; private static String shardId; - @Before + @BeforeEach public void setup() throws InterruptedException { streamName = "subscribe-to-shard-integ-test-" + System.currentTimeMillis(); @@ -80,7 +80,7 @@ public void setup() throws InterruptedException { waitForConsumerToBeActive(); } - @After + @AfterEach public void tearDown() { asyncClient.deleteStream(r -> r.streamName(streamName) .enforceConsumerDeletion(true)).join(); diff --git a/services/kms/src/it/java/software/amazon/awssdk/services/kms/IntegrationTestBase.java b/services/kms/src/it/java/software/amazon/awssdk/services/kms/IntegrationTestBase.java index 508299cee80d..dbb5859692e2 100644 --- a/services/kms/src/it/java/software/amazon/awssdk/services/kms/IntegrationTestBase.java +++ b/services/kms/src/it/java/software/amazon/awssdk/services/kms/IntegrationTestBase.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.services.kms; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.testutils.service.AwsTestBase; @@ -23,7 +23,7 @@ public class IntegrationTestBase extends AwsTestBase { protected static KmsClient kms; - @BeforeClass + @BeforeAll public static void setup() throws Exception { setUpCredentials(); kms = KmsClient.builder().region(Region.US_EAST_1).credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); diff --git a/services/kms/src/it/java/software/amazon/awssdk/services/kms/ServiceIntegrationTest.java b/services/kms/src/it/java/software/amazon/awssdk/services/kms/ServiceIntegrationTest.java index eab337e4fd1e..87c829cb29ec 100644 --- a/services/kms/src/it/java/software/amazon/awssdk/services/kms/ServiceIntegrationTest.java +++ b/services/kms/src/it/java/software/amazon/awssdk/services/kms/ServiceIntegrationTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.services.kms; import junit.framework.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.kms.model.CreateAliasRequest; import software.amazon.awssdk.services.kms.model.CreateKeyRequest; import software.amazon.awssdk.services.kms.model.CreateKeyResponse; diff --git a/services/lambda/src/it/java/software/amazon/awssdk/services/lambda/IntegrationTestBase.java b/services/lambda/src/it/java/software/amazon/awssdk/services/lambda/IntegrationTestBase.java index 8f4637789f5e..9593afeab06c 100644 --- a/services/lambda/src/it/java/software/amazon/awssdk/services/lambda/IntegrationTestBase.java +++ b/services/lambda/src/it/java/software/amazon/awssdk/services/lambda/IntegrationTestBase.java @@ -24,8 +24,8 @@ import java.time.Instant; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.iam.IamClient; import software.amazon.awssdk.services.iam.model.AttachRolePolicyRequest; @@ -65,7 +65,7 @@ public class IntegrationTestBase extends AwsTestBase { private static IamClient iam; private static KinesisClient kinesis; - @BeforeClass + @BeforeAll public static void setup() throws IOException { setUpCredentials(); lambda = LambdaAsyncClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).region(Region.US_WEST_2).build(); @@ -75,7 +75,7 @@ public static void setup() throws IOException { createLambdaServiceRole(); } - @AfterClass + @AfterAll public static void tearDown() { iam.detachRolePolicy(DetachRolePolicyRequest.builder().roleName(LAMBDA_SERVICE_ROLE_NAME).policyArn( roleExecutionPolicyArn).build()); diff --git a/services/lambda/src/it/java/software/amazon/awssdk/services/lambda/ServiceIntegrationTest.java b/services/lambda/src/it/java/software/amazon/awssdk/services/lambda/ServiceIntegrationTest.java index 10cdaa4edb4e..9d2623a43d48 100644 --- a/services/lambda/src/it/java/software/amazon/awssdk/services/lambda/ServiceIntegrationTest.java +++ b/services/lambda/src/it/java/software/amazon/awssdk/services/lambda/ServiceIntegrationTest.java @@ -20,13 +20,13 @@ import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.concurrent.TimeUnit; -import org.junit.After; +import org.junit.jupiter.api.AfterEach; import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Ignore; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.services.lambda.model.CreateEventSourceMappingRequest; import software.amazon.awssdk.services.lambda.model.CreateEventSourceMappingResponse; @@ -49,7 +49,7 @@ import software.amazon.awssdk.testutils.retry.RetryRule; import software.amazon.awssdk.utils.BinaryUtils; -@Ignore +@Disabled public class ServiceIntegrationTest extends IntegrationTestBase { private static final String FUNCTION_NAME = "java-sdk-helloworld-" + System.currentTimeMillis(); @@ -57,12 +57,12 @@ public class ServiceIntegrationTest extends IntegrationTestBase { @Rule public RetryRule retryRule = new RetryRule(10, 2000, TimeUnit.MILLISECONDS); - @BeforeClass + @BeforeAll public static void setUpKinesis() { IntegrationTestBase.createKinesisStream(); } - @Before + @BeforeEach public void uploadFunction() throws IOException { // Upload function SdkBytes functionBits; @@ -84,7 +84,7 @@ public void uploadFunction() throws IOException { checkValid_CreateFunctionResponse(result); } - @After + @AfterEach public void deleteFunction() { lambda.deleteFunction(DeleteFunctionRequest.builder().functionName(FUNCTION_NAME).build()); } diff --git a/services/machinelearning/src/it/java/software/amazon/awssdk/services/machinelearning/AmazonMachineLearningIntegrationTest.java b/services/machinelearning/src/it/java/software/amazon/awssdk/services/machinelearning/AmazonMachineLearningIntegrationTest.java index cb628f0f5188..18e0ed34f89f 100644 --- a/services/machinelearning/src/it/java/software/amazon/awssdk/services/machinelearning/AmazonMachineLearningIntegrationTest.java +++ b/services/machinelearning/src/it/java/software/amazon/awssdk/services/machinelearning/AmazonMachineLearningIntegrationTest.java @@ -20,9 +20,9 @@ import java.io.IOException; import java.time.Duration; import java.util.HashMap; -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.core.sync.RequestBody; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.machinelearning.model.CreateDataSourceFromS3Request; @@ -91,7 +91,7 @@ public class AmazonMachineLearningIntegrationTest extends AwsTestBase { private static String dataSourceId; private static String mlModelId; - @BeforeClass + @BeforeAll public static void setUp() throws IOException { setUpCredentials(); setUpS3(); @@ -122,7 +122,7 @@ private static void setUpS3() { .orFail(); } - @AfterClass + @AfterAll public static void cleanUp() { if (client != null) { if (mlModelId != null) { diff --git a/services/neptune/src/test/java/software/amazon/awssdk/services/neptune/internal/PresignRequestHandlerTest.java b/services/neptune/src/test/java/software/amazon/awssdk/services/neptune/internal/PresignRequestHandlerTest.java index 7f37b545ab99..c35e76aeb5c2 100644 --- a/services/neptune/src/test/java/software/amazon/awssdk/services/neptune/internal/PresignRequestHandlerTest.java +++ b/services/neptune/src/test/java/software/amazon/awssdk/services/neptune/internal/PresignRequestHandlerTest.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.services.neptune.internal; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.signer.AwsSignerExecutionAttribute; diff --git a/services/pinpoint/src/it/java/software/amazon/awssdk/services/pinpoint/PinpointIntegTest.java b/services/pinpoint/src/it/java/software/amazon/awssdk/services/pinpoint/PinpointIntegTest.java index 93f58481d7e3..c516b414ae86 100644 --- a/services/pinpoint/src/it/java/software/amazon/awssdk/services/pinpoint/PinpointIntegTest.java +++ b/services/pinpoint/src/it/java/software/amazon/awssdk/services/pinpoint/PinpointIntegTest.java @@ -17,8 +17,8 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.testutils.service.AwsTestBase; import software.amazon.awssdk.utils.builder.SdkBuilder; @@ -27,7 +27,7 @@ public class PinpointIntegTest extends AwsTestBase { protected static PinpointAsyncClient pinpointAsyncClient; - @BeforeClass + @BeforeAll public static void setup() { pinpointAsyncClient = PinpointAsyncClient.builder() .region(Region.US_WEST_2) diff --git a/services/polly/src/it/java/software/amazon/awssdk/services/polly/internal/presigner/DefaultPollyPresignerIntegrationTest.java b/services/polly/src/it/java/software/amazon/awssdk/services/polly/internal/presigner/DefaultPollyPresignerIntegrationTest.java index 2d971163d859..3561abcfce56 100644 --- a/services/polly/src/it/java/software/amazon/awssdk/services/polly/internal/presigner/DefaultPollyPresignerIntegrationTest.java +++ b/services/polly/src/it/java/software/amazon/awssdk/services/polly/internal/presigner/DefaultPollyPresignerIntegrationTest.java @@ -20,8 +20,8 @@ import java.net.URL; import java.time.Duration; import javax.net.ssl.HttpsURLConnection; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.polly.model.OutputFormat; import software.amazon.awssdk.services.polly.model.SynthesizeSpeechRequest; import software.amazon.awssdk.services.polly.model.VoiceId; @@ -36,7 +36,7 @@ public class DefaultPollyPresignerIntegrationTest extends AwsIntegrationTestBase private static PollyPresigner presigner; - @BeforeClass + @BeforeAll public static void setup() { presigner = DefaultPollyPresigner.builder() .credentialsProvider(getCredentialsProvider()) diff --git a/services/polly/src/test/java/software/amazon/awssdk/services/polly/internal/presigner/DefaultPollyPresignerTest.java b/services/polly/src/test/java/software/amazon/awssdk/services/polly/internal/presigner/DefaultPollyPresignerTest.java index 2f61853c7f72..a4aff005b085 100644 --- a/services/polly/src/test/java/software/amazon/awssdk/services/polly/internal/presigner/DefaultPollyPresignerTest.java +++ b/services/polly/src/test/java/software/amazon/awssdk/services/polly/internal/presigner/DefaultPollyPresignerTest.java @@ -23,8 +23,8 @@ import java.net.URI; import java.net.URL; import java.time.Duration; -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.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; @@ -49,7 +49,7 @@ public class DefaultPollyPresignerTest { private AwsCredentialsProvider credentialsProvider; - @Before + @BeforeEach public void methodSetup() { credentialsProvider = StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid")); } diff --git a/services/polly/src/test/java/software/amazon/awssdk/services/polly/internal/presigner/model/transform/SynthesizeSpeechRequestMarshallerTest.java b/services/polly/src/test/java/software/amazon/awssdk/services/polly/internal/presigner/model/transform/SynthesizeSpeechRequestMarshallerTest.java index e03997fe4736..a2184f94956c 100644 --- a/services/polly/src/test/java/software/amazon/awssdk/services/polly/internal/presigner/model/transform/SynthesizeSpeechRequestMarshallerTest.java +++ b/services/polly/src/test/java/software/amazon/awssdk/services/polly/internal/presigner/model/transform/SynthesizeSpeechRequestMarshallerTest.java @@ -20,8 +20,8 @@ import java.util.HashMap; import java.util.List; 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.SdkField; import software.amazon.awssdk.http.SdkHttpFullRequest; import software.amazon.awssdk.http.SdkHttpMethod; @@ -30,7 +30,7 @@ public class SynthesizeSpeechRequestMarshallerTest { private static Map properties; - @BeforeClass + @BeforeAll public static void setup() { properties = new HashMap<>(); diff --git a/services/rds/src/test/java/software/amazon/awssdk/services/rds/DefaultRdsUtilitiesTest.java b/services/rds/src/test/java/software/amazon/awssdk/services/rds/DefaultRdsUtilitiesTest.java index 125b899a6d4a..59b2d3db61b8 100644 --- a/services/rds/src/test/java/software/amazon/awssdk/services/rds/DefaultRdsUtilitiesTest.java +++ b/services/rds/src/test/java/software/amazon/awssdk/services/rds/DefaultRdsUtilitiesTest.java @@ -1,6 +1,6 @@ package software.amazon.awssdk.services.rds; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; diff --git a/services/rds/src/test/java/software/amazon/awssdk/services/rds/internal/PresignRequestHandlerTest.java b/services/rds/src/test/java/software/amazon/awssdk/services/rds/internal/PresignRequestHandlerTest.java index d377ab633fb4..895106750b94 100644 --- a/services/rds/src/test/java/software/amazon/awssdk/services/rds/internal/PresignRequestHandlerTest.java +++ b/services/rds/src/test/java/software/amazon/awssdk/services/rds/internal/PresignRequestHandlerTest.java @@ -28,7 +28,7 @@ import java.util.Calendar; import java.util.GregorianCalendar; import java.util.TimeZone; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.signer.AwsSignerExecutionAttribute; diff --git a/services/route53/src/it/java/software/amazon/awssdk/services/route53/Route53IntegrationTest.java b/services/route53/src/it/java/software/amazon/awssdk/services/route53/Route53IntegrationTest.java index 35e5b86138b2..2aba54fc3caa 100644 --- a/services/route53/src/it/java/software/amazon/awssdk/services/route53/Route53IntegrationTest.java +++ b/services/route53/src/it/java/software/amazon/awssdk/services/route53/Route53IntegrationTest.java @@ -22,9 +22,9 @@ import java.util.List; import java.util.UUID; -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.awscore.exception.AwsServiceException; import software.amazon.awssdk.core.SdkGlobalTime; import software.amazon.awssdk.core.exception.SdkServiceException; @@ -88,7 +88,7 @@ public class Route53IntegrationTest extends AwsIntegrationTestBase { */ private String healthCheckId; - @BeforeClass + @BeforeAll public static void setup() { route53 = Route53Client.builder() .credentialsProvider(CREDENTIALS_PROVIDER_CHAIN) @@ -109,7 +109,7 @@ public static void setup() { /** * Ensures the HostedZone we create during this test is correctly released. */ - @AfterClass + @AfterAll public static void tearDown() { try { route53.deleteHostedZone(DeleteHostedZoneRequest.builder().id(createdZoneId).build()); diff --git a/services/route53/src/test/java/software/amazon/awssdk/services/route53/QueryParamBindingTest.java b/services/route53/src/test/java/software/amazon/awssdk/services/route53/QueryParamBindingTest.java index 29813c77ea81..a4d94f1e84ac 100644 --- a/services/route53/src/test/java/software/amazon/awssdk/services/route53/QueryParamBindingTest.java +++ b/services/route53/src/test/java/software/amazon/awssdk/services/route53/QueryParamBindingTest.java @@ -19,7 +19,7 @@ import java.util.List; import java.util.Map; import junit.framework.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.client.config.SdkClientConfiguration; import software.amazon.awssdk.core.client.config.SdkClientOption; import software.amazon.awssdk.http.SdkHttpFullRequest; diff --git a/services/route53/src/test/java/software/amazon/awssdk/services/route53/Route53InterceptorTest.java b/services/route53/src/test/java/software/amazon/awssdk/services/route53/Route53InterceptorTest.java index e58496a68397..9b487790c55b 100644 --- a/services/route53/src/test/java/software/amazon/awssdk/services/route53/Route53InterceptorTest.java +++ b/services/route53/src/test/java/software/amazon/awssdk/services/route53/Route53InterceptorTest.java @@ -17,7 +17,7 @@ import static org.junit.Assert.assertEquals; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkResponse; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.core.interceptor.ExecutionInterceptor; diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/AclIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/AclIntegrationTest.java index c5bb38836cc8..bf03f12f571d 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/AclIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/AclIntegrationTest.java @@ -21,9 +21,9 @@ import static software.amazon.awssdk.testutils.service.S3BucketUtils.temporaryBucketName; import java.util.function.Consumer; -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.core.sync.RequestBody; import software.amazon.awssdk.services.s3.model.AccessControlPolicy; import software.amazon.awssdk.services.s3.model.GetBucketAclResponse; @@ -36,7 +36,7 @@ public class AclIntegrationTest extends S3IntegrationTestBase { private static final String KEY = "some-key"; - @BeforeClass + @BeforeAll public static void setupFixture() { createBucket(BUCKET); s3.putObject(PutObjectRequest.builder() @@ -45,7 +45,7 @@ public static void setupFixture() { .build(), RequestBody.fromString("helloworld")); } - @AfterClass + @AfterAll public static void deleteAllBuckets() { deleteBucketAndAllContents(BUCKET); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/AsyncGetObjectFaultIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/AsyncGetObjectFaultIntegrationTest.java index 6b3972c2f190..f75bce182f17 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/AsyncGetObjectFaultIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/AsyncGetObjectFaultIntegrationTest.java @@ -23,9 +23,9 @@ import java.time.Duration; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; -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.core.ResponseBytes; import software.amazon.awssdk.core.async.AsyncResponseTransformer; import software.amazon.awssdk.core.async.SdkPublisher; @@ -44,7 +44,7 @@ public class AsyncGetObjectFaultIntegrationTest extends S3IntegrationTestBase { private static S3AsyncClient s3ClientWithTimeout; - @BeforeClass + @BeforeAll public static void setupFixture() { createBucket(BUCKET); s3.putObject(PutObjectRequest.builder() @@ -58,7 +58,7 @@ public static void setupFixture() { .build(); } - @AfterClass + @AfterAll public static void tearDownFixture() { deleteBucketAndAllContents(BUCKET); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/AsyncServerSideEncryptionIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/AsyncServerSideEncryptionIntegrationTest.java index 70241622f610..c1e4d426f3be 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/AsyncServerSideEncryptionIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/AsyncServerSideEncryptionIntegrationTest.java @@ -20,7 +20,7 @@ import java.io.FileNotFoundException; import java.util.Base64; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.async.AsyncResponseTransformer; import software.amazon.awssdk.services.s3.model.GetObjectRequest; import software.amazon.awssdk.services.s3.model.PutObjectRequest; diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/BucketAccelerateIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/BucketAccelerateIntegrationTest.java index cee5a393032a..036d47e24c8d 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/BucketAccelerateIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/BucketAccelerateIntegrationTest.java @@ -19,11 +19,9 @@ import static software.amazon.awssdk.testutils.service.S3BucketUtils.temporaryBucketName; import java.io.File; -import java.util.List; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -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.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.core.interceptor.ExecutionInterceptor; @@ -31,23 +29,11 @@ import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.model.AccelerateConfiguration; import software.amazon.awssdk.services.s3.model.BucketAccelerateStatus; -import software.amazon.awssdk.services.s3.model.BucketVersioningStatus; -import software.amazon.awssdk.services.s3.model.DeleteBucketTaggingRequest; import software.amazon.awssdk.services.s3.model.GetBucketAccelerateConfigurationRequest; -import software.amazon.awssdk.services.s3.model.GetBucketTaggingRequest; -import software.amazon.awssdk.services.s3.model.GetBucketVersioningRequest; import software.amazon.awssdk.services.s3.model.ListBucketsRequest; import software.amazon.awssdk.services.s3.model.PutBucketAccelerateConfigurationRequest; -import software.amazon.awssdk.services.s3.model.PutBucketTaggingRequest; -import software.amazon.awssdk.services.s3.model.PutBucketVersioningRequest; import software.amazon.awssdk.services.s3.model.PutObjectRequest; -import software.amazon.awssdk.services.s3.model.Tag; -import software.amazon.awssdk.services.s3.model.Tagging; -import software.amazon.awssdk.services.s3.model.VersioningConfiguration; import software.amazon.awssdk.testutils.RandomTempFile; -import software.amazon.awssdk.testutils.retry.AssertCallable; -import software.amazon.awssdk.testutils.retry.RetryableAssertion; -import software.amazon.awssdk.testutils.retry.RetryableParams; /** * Integration tests for S3 bucket accelerate configuration. @@ -59,7 +45,7 @@ public class BucketAccelerateIntegrationTest extends S3IntegrationTestBase { private static S3Client accelerateClient; - @BeforeClass + @BeforeAll public static void setup() throws Exception { S3IntegrationTestBase.setUp(); @@ -75,7 +61,7 @@ public static void setup() throws Exception { setUpBuckets(); } - @AfterClass + @AfterAll public static void cleanup() { deleteBucketAndAllContents(US_BUCKET_NAME); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/BucketInventoryConfigurationIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/BucketInventoryConfigurationIntegrationTest.java index 9a866d8b5768..5a9fd0f7019d 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/BucketInventoryConfigurationIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/BucketInventoryConfigurationIntegrationTest.java @@ -22,9 +22,9 @@ import java.util.ArrayList; import java.util.List; -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.core.sync.RequestBody; import software.amazon.awssdk.services.s3.model.DeleteBucketInventoryConfigurationRequest; import software.amazon.awssdk.services.s3.model.GetBucketInventoryConfigurationRequest; @@ -55,7 +55,7 @@ public class BucketInventoryConfigurationIntegrationTest extends S3IntegrationTe */ private static final String KEY = "key"; - @BeforeClass + @BeforeAll public static void setUpFixture() throws Exception { S3IntegrationTestBase.setUp(); createBucket(BUCKET_NAME); @@ -66,7 +66,7 @@ public static void setUpFixture() throws Exception { RequestBody.fromFile(new RandomTempFile("foo", 1024))); } - @AfterClass + @AfterAll public static void tearDownFixture() { deleteBucketAndAllContents(BUCKET_NAME); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/CopyObjectIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/CopyObjectIntegrationTest.java index 2e956d06538d..0d4e7787a377 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/CopyObjectIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/CopyObjectIntegrationTest.java @@ -19,9 +19,9 @@ import java.io.File; import java.util.Date; -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.core.sync.RequestBody; import software.amazon.awssdk.services.s3.model.CopyObjectRequest; import software.amazon.awssdk.services.s3.model.HeadObjectRequest; @@ -57,7 +57,7 @@ public class CopyObjectIntegrationTest extends S3IntegrationTestBase { /** * Releases resources used by tests. */ - @AfterClass + @AfterAll public static void tearDown() { deleteBucketAndAllContents(BUCKET_NAME); file.delete(); @@ -67,7 +67,7 @@ public static void tearDown() { * Creates/populates all the test data needed for these tests (bucket, * source object, file, source object ETag, etc). */ - @BeforeClass + @BeforeAll public static void initializeTestData() throws Exception { createBucket(BUCKET_NAME); diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/ExceptionUnmarshallingIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/ExceptionUnmarshallingIntegrationTest.java index 583335092cc5..1949ac8a26f6 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/ExceptionUnmarshallingIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/ExceptionUnmarshallingIntegrationTest.java @@ -21,12 +21,11 @@ import java.nio.charset.StandardCharsets; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.regions.Region; -import software.amazon.awssdk.services.s3.model.BucketAlreadyExistsException; import software.amazon.awssdk.services.s3.model.BucketAlreadyOwnedByYouException; import software.amazon.awssdk.services.s3.model.GetObjectRequest; import software.amazon.awssdk.services.s3.model.NoSuchBucketException; @@ -40,12 +39,12 @@ public class ExceptionUnmarshallingIntegrationTest extends S3IntegrationTestBase private static final String KEY = "some-key"; - @BeforeClass + @BeforeAll public static void setupFixture() { createBucket(BUCKET); } - @AfterClass + @AfterAll public static void tearDownFixture() { deleteBucketAndAllContents(BUCKET); } @@ -160,7 +159,7 @@ public void asyncHeadBucketWrongRegion() { } @Test - @Ignore("TODO") + @Disabled("TODO") public void errorResponseContainsRawBytes() { assertThatThrownBy(() -> s3.getObjectAcl(b -> b.bucket(BUCKET + KEY).key(KEY))) .isInstanceOf(NoSuchBucketException.class) diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectAsyncIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectAsyncIntegrationTest.java index db48fbe37a7c..6fdaf10b8fa1 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectAsyncIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectAsyncIntegrationTest.java @@ -26,9 +26,9 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.concurrent.CompletableFuture; -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.core.SdkResponse; import software.amazon.awssdk.core.async.AsyncResponseTransformer; import software.amazon.awssdk.core.async.SdkPublisher; @@ -56,7 +56,7 @@ public class GetObjectAsyncIntegrationTest extends S3IntegrationTestBase { private static File file; - @BeforeClass + @BeforeAll public static void setupFixture() throws IOException { createBucket(BUCKET); file = new RandomTempFile(10_000); @@ -68,7 +68,7 @@ public static void setupFixture() throws IOException { s3Async.waiter().waitUntilObjectExists(b -> b.bucket(BUCKET).key(KEY)).join(); } - @AfterClass + @AfterAll public static void tearDownFixture() { deleteBucketAndAllContents(BUCKET); file.delete(); diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectFaultIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectFaultIntegrationTest.java index 414e8edb4727..6cf61f4d72ae 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectFaultIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectFaultIntegrationTest.java @@ -22,9 +22,9 @@ import java.time.Duration; import java.util.concurrent.atomic.AtomicInteger; -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.core.client.config.ClientOverrideConfiguration; import software.amazon.awssdk.core.exception.ApiCallTimeoutException; import software.amazon.awssdk.core.exception.NonRetryableException; @@ -45,7 +45,7 @@ public class GetObjectFaultIntegrationTest extends S3IntegrationTestBase { private static S3Client s3ClientWithTimeout; - @BeforeClass + @BeforeAll public static void setupFixture() { createBucket(BUCKET); s3.putObject(PutObjectRequest.builder() @@ -59,7 +59,7 @@ public static void setupFixture() { .build(); } - @AfterClass + @AfterAll public static void tearDownFixture() { deleteBucketAndAllContents(BUCKET); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectIntegrationTest.java index fcb78ef29325..c14a194246a4 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/GetObjectIntegrationTest.java @@ -24,9 +24,9 @@ import java.io.IOException; import java.nio.file.Path; import java.util.Properties; -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.core.ResponseInputStream; import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; import software.amazon.awssdk.core.interceptor.ExecutionInterceptor; @@ -52,7 +52,7 @@ public class GetObjectIntegrationTest extends S3IntegrationTestBase { private static File file; - @BeforeClass + @BeforeAll public static void setupFixture() throws IOException { createBucket(BUCKET); file = new RandomTempFile(10_000); @@ -62,7 +62,7 @@ public static void setupFixture() throws IOException { .build(), file.toPath()); } - @AfterClass + @AfterAll public static void tearDownFixture() { deleteBucketAndAllContents(BUCKET); file.delete(); diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/HeadObjectIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/HeadObjectIntegrationTest.java index 11cafaf1c3c2..44564887ff34 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/HeadObjectIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/HeadObjectIntegrationTest.java @@ -23,11 +23,10 @@ import java.nio.charset.StandardCharsets; import java.util.zip.GZIPOutputStream; -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.core.sync.RequestBody; -import software.amazon.awssdk.services.s3.model.HeadObjectRequest; import software.amazon.awssdk.services.s3.model.HeadObjectResponse; import software.amazon.awssdk.services.s3.model.PutObjectRequest; @@ -36,7 +35,7 @@ public class HeadObjectIntegrationTest extends S3IntegrationTestBase { private static final String GZIPPED_KEY = "some-key"; - @BeforeClass + @BeforeAll public static void setupFixture() throws IOException { createBucket(BUCKET); @@ -64,7 +63,7 @@ public void syncClientSupportsGzippedObjects() { assertThat(response.contentEncoding()).isEqualTo("gzip"); } - @AfterClass + @AfterAll public static void cleanup() { deleteBucketAndAllContents(BUCKET); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/KeysWithLeadingSlashIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/KeysWithLeadingSlashIntegrationTest.java index aeb10a99dc6f..ef917e976b41 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/KeysWithLeadingSlashIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/KeysWithLeadingSlashIntegrationTest.java @@ -18,9 +18,9 @@ import static software.amazon.awssdk.testutils.service.S3BucketUtils.temporaryBucketName; import java.nio.charset.StandardCharsets; -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.core.sync.RequestBody; public class KeysWithLeadingSlashIntegrationTest extends S3IntegrationTestBase { @@ -31,13 +31,13 @@ public class KeysWithLeadingSlashIntegrationTest extends S3IntegrationTestBase { private static final String KEY_WITH_SLASH_AND_SPECIAL_CHARS = "/special-chars-@$%"; private static final byte[] CONTENT = "Hello".getBytes(StandardCharsets.UTF_8); - @BeforeClass + @BeforeAll public static void setUp() throws Exception { S3IntegrationTestBase.setUp(); createBucket(BUCKET); } - @AfterClass + @AfterAll public static void cleanup() { deleteBucketAndAllContents(BUCKET); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/ListObjectsIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/ListObjectsIntegrationTest.java index d3a039f7478e..bac1cc5ee634 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/ListObjectsIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/ListObjectsIntegrationTest.java @@ -29,9 +29,9 @@ import java.util.ArrayList; import java.util.List; 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 software.amazon.awssdk.core.sync.RequestBody; import software.amazon.awssdk.services.s3.model.EncodingType; import software.amazon.awssdk.services.s3.model.ListObjectsRequest; @@ -64,7 +64,7 @@ public class ListObjectsIntegrationTest extends S3IntegrationTestBase { /** * Releases all resources created in this test. */ - @AfterClass + @AfterAll public static void tearDown() { deleteBucketAndAllContents(bucketName); } @@ -72,7 +72,7 @@ public static void tearDown() { /** * Creates all the test resources for the tests. */ - @BeforeClass + @BeforeAll public static void createResources() throws Exception { createBucket(bucketName); diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/ListObjectsV2PaginatorsIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/ListObjectsV2PaginatorsIntegrationTest.java index f0333b3b715e..82c8f7d5713a 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/ListObjectsV2PaginatorsIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/ListObjectsV2PaginatorsIntegrationTest.java @@ -31,9 +31,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.stream.Stream; -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.sync.RequestBody; @@ -71,7 +71,7 @@ public class ListObjectsV2PaginatorsIntegrationTest extends S3IntegrationTestBas /** * Releases all resources created in this test. */ - @AfterClass + @AfterAll public static void tearDown() { deleteBucketAndAllContents(bucketName); deleteBucketAndAllContents(emptyBucketName); @@ -80,7 +80,7 @@ public static void tearDown() { /** * Creates all the test resources for the tests. */ - @BeforeClass + @BeforeAll public static void createResources() throws Exception { createBucket(bucketName); createBucket(emptyBucketName); diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/ObjectTaggingIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/ObjectTaggingIntegrationTest.java index f27a5534e889..63e35319bc1a 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/ObjectTaggingIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/ObjectTaggingIntegrationTest.java @@ -21,9 +21,9 @@ import java.util.ArrayList; import java.util.List; 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 software.amazon.awssdk.core.sync.RequestBody; import software.amazon.awssdk.services.s3.model.BucketVersioningStatus; import software.amazon.awssdk.services.s3.model.CompletedMultipartUpload; @@ -45,7 +45,7 @@ public class ObjectTaggingIntegrationTest extends S3IntegrationTestBase { private static final String KEY_PREFIX = "tagged-object-"; private static final String BUCKET = temporaryBucketName("java-object-tagging-bucket-"); - @BeforeClass + @BeforeAll public static void setUp() throws Exception { S3IntegrationTestBase.setUp(); createBucket(BUCKET); @@ -59,7 +59,7 @@ public static void setUp() throws Exception { .build()); } - @AfterClass + @AfterAll public static void tearDown() { deleteBucketAndAllContents(BUCKET); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/OperationsWithNonStandardResponsesIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/OperationsWithNonStandardResponsesIntegrationTest.java index bb2142bebbf6..0a88c7d766c4 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/OperationsWithNonStandardResponsesIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/OperationsWithNonStandardResponsesIntegrationTest.java @@ -21,9 +21,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; -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.core.auth.policy.Action; import software.amazon.awssdk.core.auth.policy.Policy; import software.amazon.awssdk.core.auth.policy.Principal; @@ -44,12 +44,12 @@ public final class OperationsWithNonStandardResponsesIntegrationTest extends S3I */ private static String bucketName = temporaryBucketName("single-string-integ-test"); - @BeforeClass + @BeforeAll public static void setupSuite() { createBucket(bucketName); } - @AfterClass + @AfterAll public static void cleanup() { s3.deleteBucket(DeleteBucketRequest.builder().bucket(bucketName).build()); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/PutObjectIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/PutObjectIntegrationTest.java index 1eeb02e1e54e..dbd187358af6 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/PutObjectIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/PutObjectIntegrationTest.java @@ -27,12 +27,11 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -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.core.sync.RequestBody; import software.amazon.awssdk.http.ContentStreamProvider; -import software.amazon.awssdk.services.s3.model.PutObjectResponse; /** * Integration tests for {@code PutObject}. @@ -42,13 +41,13 @@ public class PutObjectIntegrationTest extends S3IntegrationTestBase { private static final String KEY = "key"; private static final byte[] CONTENT = "Hello".getBytes(StandardCharsets.UTF_8); - @BeforeClass + @BeforeAll public static void setUp() throws Exception { S3IntegrationTestBase.setUp(); createBucket(BUCKET); } - @AfterClass + @AfterAll public static void tearDown() { deleteBucketAndAllContents(BUCKET); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3IntegrationTestBase.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3IntegrationTestBase.java index f38a93e59fdb..fd437c7e865f 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3IntegrationTestBase.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3IntegrationTestBase.java @@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.core.ClientType; import software.amazon.awssdk.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; @@ -48,7 +48,7 @@ public class S3IntegrationTestBase extends AwsTestBase { * Loads the AWS account info for the integration tests and creates an S3 * client for tests to use. */ - @BeforeClass + @BeforeAll public static void setUp() throws Exception { s3 = s3ClientBuilder().build(); s3Async = s3AsyncClientBuilder().build(); diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3ListObjectsV2IntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3ListObjectsV2IntegrationTest.java index 0e64f5e4135f..4a0f34a1f7f0 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3ListObjectsV2IntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3ListObjectsV2IntegrationTest.java @@ -32,9 +32,9 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; -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.core.sync.RequestBody; import software.amazon.awssdk.services.s3.model.ListObjectsV2Request; import software.amazon.awssdk.services.s3.model.ListObjectsV2Response; @@ -72,7 +72,7 @@ public class S3ListObjectsV2IntegrationTest extends S3IntegrationTestBase { /** * Releases all resources created in this test. */ - @AfterClass + @AfterAll public static void tearDown() { deleteBucketAndAllContents(bucketName); } @@ -80,7 +80,7 @@ public static void tearDown() { /** * Creates all the test resources for the tests. */ - @BeforeClass + @BeforeAll public static void createResources() throws Exception { createBucket(bucketName); diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3PresignerIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3PresignerIntegrationTest.java index 1ca5526a1e4b..6cb8b5de949e 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3PresignerIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3PresignerIntegrationTest.java @@ -24,11 +24,11 @@ import java.util.Optional; import java.util.UUID; import java.util.function.Consumer; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.awscore.presigner.PresignedRequest; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.core.sync.RequestBody; @@ -66,7 +66,7 @@ public class S3PresignerIntegrationTest { private S3Presigner presigner; - @BeforeClass + @BeforeAll public static void setUpClass() { client = S3Client.create(); testBucket = S3TestUtils.getTestBucket(client); @@ -78,7 +78,7 @@ public static void setUpClass() { S3TestUtils.putObject(S3PresignerIntegrationTest.class, client, testNonDnsCompatibleBucket, testGetObjectKey, testObjectContent); } - @AfterClass + @AfterAll public static void tearDownClass() { S3TestUtils.runCleanupTasks(S3PresignerIntegrationTest.class); client.close(); @@ -88,12 +88,12 @@ private static String generateRandomObjectKey() { return "s3-presigner-it-" + UUID.randomUUID(); } - @Before + @BeforeEach public void setUpInstance() { this.presigner = S3Presigner.create(); } - @After + @AfterEach public void testDownInstance() { this.presigner.close(); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3ResponseMetadataIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3ResponseMetadataIntegrationTest.java index 1763788d1627..a4154c6aecae 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3ResponseMetadataIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/S3ResponseMetadataIntegrationTest.java @@ -20,9 +20,9 @@ import java.io.File; import java.io.IOException; -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.core.ResponseBytes; import software.amazon.awssdk.core.async.AsyncResponseTransformer; import software.amazon.awssdk.core.sync.ResponseTransformer; @@ -41,7 +41,7 @@ public class S3ResponseMetadataIntegrationTest extends S3IntegrationTestBase { private static File file; - @BeforeClass + @BeforeAll public static void setupFixture() throws IOException { createBucket(BUCKET); file = new RandomTempFile(10_000); @@ -51,7 +51,7 @@ public static void setupFixture() throws IOException { .build(), file.toPath()); } - @AfterClass + @AfterAll public static void deleteAllBuckets() { deleteBucketAndAllContents(BUCKET); file.delete(); diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/ServerSideEncryptionIntegrationTestBase.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/ServerSideEncryptionIntegrationTestBase.java index 32d7ba225af4..07e3d6d28e7a 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/ServerSideEncryptionIntegrationTestBase.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/ServerSideEncryptionIntegrationTestBase.java @@ -15,15 +15,14 @@ package software.amazon.awssdk.services.s3; import static org.assertj.core.api.Fail.fail; -import static software.amazon.awssdk.services.s3.S3IntegrationTestBase.createBucket; import static software.amazon.awssdk.testutils.service.S3BucketUtils.temporaryBucketName; import java.io.File; import java.io.IOException; import java.security.SecureRandom; import javax.crypto.KeyGenerator; -import org.junit.AfterClass; -import org.junit.BeforeClass; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.services.kms.KmsClient; import software.amazon.awssdk.services.s3.model.ServerSideEncryption; import software.amazon.awssdk.testutils.RandomTempFile; @@ -42,7 +41,7 @@ public class ServerSideEncryptionIntegrationTestBase extends S3IntegrationTestBa private static String keyId; - @BeforeClass + @BeforeAll public static void setupFixture() throws IOException { createBucket(BUCKET); createBucket(BUCKET_WITH_SSE); @@ -57,7 +56,7 @@ public static void setupFixture() throws IOException { file = new RandomTempFile(10_000); } - @AfterClass + @AfterAll public static void tearDownFixture() { deleteBucketAndAllContents(BUCKET); deleteBucketAndAllContents(BUCKET_WITH_SSE); diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/SignedAsyncRequestBodyUploadIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/SignedAsyncRequestBodyUploadIntegrationTest.java index c8752045d1a5..7f53360c8c2b 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/SignedAsyncRequestBodyUploadIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/SignedAsyncRequestBodyUploadIntegrationTest.java @@ -27,10 +27,10 @@ import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.signer.AsyncAws4Signer; import software.amazon.awssdk.core.async.AsyncRequestBody; import software.amazon.awssdk.core.interceptor.Context; @@ -55,7 +55,7 @@ public class SignedAsyncRequestBodyUploadIntegrationTest extends S3IntegrationTe private static TestSigner mockSigner; private static final CapturingInterceptor capturingInterceptor = new CapturingInterceptor(); - @BeforeClass + @BeforeAll public static void setup() throws Exception { S3IntegrationTestBase.setUp(); @@ -81,7 +81,7 @@ public static void setup() throws Exception { createBucket(BUCKET); } - @AfterClass + @AfterAll public static void teardown() { S3TestUtils.deleteBucketAndAllContents(s3, BUCKET); s3.close(); @@ -89,7 +89,7 @@ public static void teardown() { testClient.close(); } - @Before + @BeforeEach public void methodSetup() { capturingInterceptor.reset(); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/SyncServerSideEncryptionIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/SyncServerSideEncryptionIntegrationTest.java index 23235b89a21b..830b3d2c8704 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/SyncServerSideEncryptionIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/SyncServerSideEncryptionIntegrationTest.java @@ -21,7 +21,7 @@ import java.io.InputStream; import java.util.Base64; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.sync.ResponseTransformer; import software.amazon.awssdk.services.s3.model.GetObjectRequest; import software.amazon.awssdk.services.s3.model.PutObjectRequest; diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/UploadLargeObjectIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/UploadLargeObjectIntegrationTest.java index c6f9db74bb30..b20de834875c 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/UploadLargeObjectIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/UploadLargeObjectIntegrationTest.java @@ -19,10 +19,9 @@ import java.io.File; import java.io.IOException; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Ignore; -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.core.ResponseInputStream; import software.amazon.awssdk.services.s3.model.GetObjectResponse; import software.amazon.awssdk.testutils.RandomTempFile; @@ -37,13 +36,13 @@ public class UploadLargeObjectIntegrationTest extends S3IntegrationTestBase { private static File file; - @BeforeClass + @BeforeAll public static void setupFixture() throws IOException { createBucket(BUCKET); file = new RandomTempFile(500 * 1024 * 1024); } - @AfterClass + @AfterAll public static void tearDownFixture() { deleteBucketAndAllContents(BUCKET); file.delete(); diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/UploadMultiplePartTestBase.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/UploadMultiplePartTestBase.java index 9ebce247c716..524fd67ad897 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/UploadMultiplePartTestBase.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/UploadMultiplePartTestBase.java @@ -22,9 +22,9 @@ import java.util.List; import java.util.concurrent.Callable; 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 software.amazon.awssdk.core.ResponseBytes; import software.amazon.awssdk.core.sync.ResponseTransformer; import software.amazon.awssdk.services.s3.model.AbortMultipartUploadRequest; @@ -48,12 +48,12 @@ public abstract class UploadMultiplePartTestBase extends S3IntegrationTestBase { private static final String BUCKET = temporaryBucketName(AsyncUploadMultiplePartIntegrationTest.class); private static final String CONTENT = RandomStringUtils.randomAscii(1000); - @BeforeClass + @BeforeAll public static void setupFixture() { createBucket(BUCKET); } - @AfterClass + @AfterAll public static void tearDownFixture() { deleteBucketAndAllContents(BUCKET); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/UrlEncodingIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/UrlEncodingIntegrationTest.java index e988c458c2b0..302ba804ae74 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/UrlEncodingIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/UrlEncodingIntegrationTest.java @@ -19,9 +19,9 @@ import static software.amazon.awssdk.testutils.service.S3BucketUtils.temporaryBucketName; 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 software.amazon.awssdk.core.sync.RequestBody; import software.amazon.awssdk.services.s3.model.CreateMultipartUploadResponse; import software.amazon.awssdk.services.s3.model.EncodingType; @@ -42,7 +42,7 @@ public class UrlEncodingIntegrationTest extends S3IntegrationTestBase { private static final String BUCKET_NAME = temporaryBucketName(UrlEncodingIntegrationTest.class); private static final String KEY_NAME_WITH_SPECIAL_CHARS = "filename_@_=_&_?_+_)_.temp"; - @BeforeClass + @BeforeAll public static void createResources() { createBucket(BUCKET_NAME); s3.putObject(PutObjectRequest.builder() @@ -54,7 +54,7 @@ public static void createResources() { /** * Releases all resources created in this test. */ - @AfterClass + @AfterAll public static void tearDown() { deleteBucketAndAllContents(BUCKET_NAME); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/UserMetadataIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/UserMetadataIntegrationTest.java index e24c029da125..46450f7d7c9b 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/UserMetadataIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/UserMetadataIntegrationTest.java @@ -21,9 +21,9 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; -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.core.sync.RequestBody; import software.amazon.awssdk.services.s3.model.HeadObjectRequest; import software.amazon.awssdk.services.s3.model.HeadObjectResponse; @@ -51,7 +51,7 @@ public class UserMetadataIntegrationTest extends S3IntegrationTestBase { * Creates/populates all the test data needed for these tests (bucket, * source object, file, source object ETag, etc). */ - @BeforeClass + @BeforeAll public static void initializeTestData() throws Exception { createBucket(BUCKET_NAME); @@ -62,7 +62,7 @@ public static void initializeTestData() throws Exception { .build(), file.toPath()); } - @AfterClass + @AfterAll public static void deleteAllBuckets() { deleteBucketAndAllContents(BUCKET_NAME); } diff --git a/services/s3/src/it/java/software/amazon/awssdk/services/s3/signer/PayloadSigningIntegrationTest.java b/services/s3/src/it/java/software/amazon/awssdk/services/s3/signer/PayloadSigningIntegrationTest.java index ca77bc1cc588..2d7129f655ba 100644 --- a/services/s3/src/it/java/software/amazon/awssdk/services/s3/signer/PayloadSigningIntegrationTest.java +++ b/services/s3/src/it/java/software/amazon/awssdk/services/s3/signer/PayloadSigningIntegrationTest.java @@ -25,10 +25,10 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import org.junit.AfterClass; -import org.junit.Before; -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.BeforeEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.signer.S3SignerExecutionAttribute; import software.amazon.awssdk.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; @@ -53,19 +53,19 @@ public class PayloadSigningIntegrationTest extends S3IntegrationTestBase { private static final CapturingInterceptor capturingInterceptor = new CapturingInterceptor(); - @BeforeClass + @BeforeAll public static void setup() throws Exception { S3IntegrationTestBase.setUp(); createBucket(BUCKET); } - @AfterClass + @AfterAll public static void teardown() { S3TestUtils.deleteBucketAndAllContents(s3, BUCKET); s3.close(); } - @Before + @BeforeEach public void methodSetup() { capturingInterceptor.reset(); } diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/AclTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/AclTest.java index bc558e57fae7..7ac18028e128 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/AclTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/AclTest.java @@ -29,9 +29,9 @@ import java.net.URI; import java.util.ArrayList; import java.util.List; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; @@ -55,7 +55,7 @@ public class AclTest { private S3Client s3Client; - @Before + @BeforeEach public void setup() { URI endpoint = URI.create("http://localhost:" + mockServer.port()); s3Client = S3Client.builder() diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/EndpointOverrideTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/EndpointOverrideTest.java index 0d58559d4e5d..c2a8df89d6a6 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/EndpointOverrideTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/EndpointOverrideTest.java @@ -24,9 +24,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.io.IOException; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.async.AsyncResponseTransformer; @@ -41,7 +41,7 @@ public class EndpointOverrideTest { private S3AsyncClient s3AsyncClient; - @Before + @BeforeEach public void setup() { s3Client = S3Client.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/InvalidRegionTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/InvalidRegionTest.java index 467f949301dd..2d34ed8a6f2e 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/InvalidRegionTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/InvalidRegionTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.time.Duration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider; import software.amazon.awssdk.core.exception.SdkClientException; import software.amazon.awssdk.regions.Region; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/MultipartUploadTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/MultipartUploadTest.java index 1c314ded4fc5..f30ec80c00f9 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/MultipartUploadTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/MultipartUploadTest.java @@ -28,9 +28,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; @@ -44,7 +44,7 @@ public class MultipartUploadTest { private S3AsyncClient s3AsyncClient; - @Before + @BeforeEach public void setup() { s3Client = S3Client.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/S3ConfigurationTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/S3ConfigurationTest.java index 608fd8c133d9..42f7e567f1c2 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/S3ConfigurationTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/S3ConfigurationTest.java @@ -20,15 +20,15 @@ import static software.amazon.awssdk.services.s3.S3SystemSetting.AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS; import static software.amazon.awssdk.services.s3.S3SystemSetting.AWS_S3_USE_ARN_REGION; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.testutils.EnvironmentVariableHelper; public class S3ConfigurationTest { private final EnvironmentVariableHelper helper = new EnvironmentVariableHelper(); - @After + @AfterEach public void clearSystemProperty() { System.clearProperty(AWS_S3_USE_ARN_REGION.property()); System.clearProperty(AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS.property()); diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumResetsOnRetryTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumResetsOnRetryTest.java index 7977ca2d01c2..cef5a4984e15 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumResetsOnRetryTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumResetsOnRetryTest.java @@ -24,8 +24,6 @@ import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder; import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.common.ConsoleNotifier; -import com.github.tomakehurst.wiremock.common.Slf4jNotifier; import com.github.tomakehurst.wiremock.core.WireMockConfiguration; import com.github.tomakehurst.wiremock.junit.WireMockRule; import com.github.tomakehurst.wiremock.stubbing.Scenario; @@ -33,9 +31,9 @@ import java.nio.charset.StandardCharsets; import java.util.function.Consumer; import org.apache.commons.lang3.ArrayUtils; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.ResponseBytes; @@ -65,7 +63,7 @@ public class ChecksumResetsOnRetryTest { private String bodyEtag; - @Before + @BeforeEach public void setup() { StaticCredentialsProvider credentials = StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid")); s3Client = S3Client.builder() diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumValidatingInputStreamTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumValidatingInputStreamTest.java index a83bf45b4155..7f122c46cbeb 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumValidatingInputStreamTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumValidatingInputStreamTest.java @@ -22,8 +22,8 @@ import java.io.InputStream; import java.util.Arrays; import org.junit.Assert; -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.checksums.Md5Checksum; import software.amazon.awssdk.core.exception.SdkClientException; import software.amazon.awssdk.utils.IoUtils; @@ -35,7 +35,7 @@ public class ChecksumValidatingInputStreamTest { private static byte[] testData; private static byte[] testDataWithoutChecksum; - @BeforeClass + @BeforeAll public static void populateData() { testData = new byte[TEST_DATA_SIZE + CHECKSUM_SIZE]; for (int i = 0; i < TEST_DATA_SIZE; i++) { diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumValidatingPublisherTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumValidatingPublisherTest.java index 23027a2317fc..49c1044850b6 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumValidatingPublisherTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumValidatingPublisherTest.java @@ -27,8 +27,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; @@ -44,7 +44,7 @@ public class ChecksumValidatingPublisherTest { private static byte[] testData; private static byte[] testDataWithoutChecksum; - @BeforeClass + @BeforeAll public static void populateData() { testData = new byte[TEST_DATA_SIZE + CHECKSUM_SIZE]; for (int i = 0; i < TEST_DATA_SIZE; i++) { diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumsEnabledValidatorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumsEnabledValidatorTest.java index b2e26e837ffa..25e30bc4e610 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumsEnabledValidatorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/checksums/ChecksumsEnabledValidatorTest.java @@ -29,7 +29,7 @@ import static software.amazon.awssdk.services.s3.checksums.ChecksumsEnabledValidator.shouldRecordChecksum; import static software.amazon.awssdk.services.s3.model.ServerSideEncryption.AWS_KMS; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.ClientType; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.http.SdkHttpFullRequest; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/CompleteMultipartUploadFunctionalTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/CompleteMultipartUploadFunctionalTest.java index c9488c9ca634..e0804dac2425 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/CompleteMultipartUploadFunctionalTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/CompleteMultipartUploadFunctionalTest.java @@ -28,10 +28,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import org.junit.Rule; -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.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.S3AsyncClient; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/ContentLengthMismatchTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/ContentLengthMismatchTest.java index 89870fab2758..cdc68bd57cb5 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/ContentLengthMismatchTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/ContentLengthMismatchTest.java @@ -32,7 +32,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reactivestreams.Subscriber; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/GetBucketPolicyFunctionalTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/GetBucketPolicyFunctionalTest.java index 6933e8726648..97efc701d050 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/GetBucketPolicyFunctionalTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/GetBucketPolicyFunctionalTest.java @@ -23,12 +23,11 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.net.URI; -import java.util.concurrent.CompletionException; import com.github.tomakehurst.wiremock.junit.WireMockRule; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; @@ -37,9 +36,7 @@ import software.amazon.awssdk.services.s3.S3AsyncClientBuilder; import software.amazon.awssdk.services.s3.S3Client; import software.amazon.awssdk.services.s3.S3ClientBuilder; -import software.amazon.awssdk.services.s3.model.CompleteMultipartUploadResponse; import software.amazon.awssdk.services.s3.model.GetBucketPolicyResponse; -import software.amazon.awssdk.services.s3.model.S3Exception; public class GetBucketPolicyFunctionalTest { private static final URI HTTP_LOCALHOST_URI = URI.create("http://localhost:8080/"); diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/MultiRegionAccessPointSigningFunctionalTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/MultiRegionAccessPointSigningFunctionalTest.java index 77f1746ff2b9..08e5be5e094d 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/MultiRegionAccessPointSigningFunctionalTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/functionaltests/MultiRegionAccessPointSigningFunctionalTest.java @@ -22,8 +22,8 @@ import java.io.UnsupportedEncodingException; import java.util.List; import java.util.Map; -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.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.auth.signer.AwsS3V4Signer; @@ -51,7 +51,7 @@ public class MultiRegionAccessPointSigningFunctionalTest { private MockHttpClient mockHttpClient; - @Before + @BeforeEach public void setup() throws UnsupportedEncodingException { mockHttpClient = new MockSyncHttpClient(); mockHttpClient.stubNextResponse(mockListObjectsResponse()); diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3AccessPointEndpointResolverTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3AccessPointEndpointResolverTest.java index bf42b27ef60c..ea84990368c2 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3AccessPointEndpointResolverTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3AccessPointEndpointResolverTest.java @@ -15,8 +15,8 @@ package software.amazon.awssdk.services.s3.internal.endpoints; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.S3Configuration; import software.amazon.awssdk.services.s3.internal.ConfiguredS3SdkHttpRequest; @@ -33,7 +33,7 @@ public class S3AccessPointEndpointResolverTest { S3AccessPointEndpointResolver endpointResolver; - @Before + @BeforeEach public void setUp() { endpointResolver = S3AccessPointEndpointResolver.create(); } diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3BucketEndpointResolverTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3BucketEndpointResolverTest.java index bde1afceacfb..bf58d2fc3f51 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3BucketEndpointResolverTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3BucketEndpointResolverTest.java @@ -18,19 +18,15 @@ import static org.assertj.core.api.Assertions.assertThat; import java.net.URI; -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.SdkRequest; -import software.amazon.awssdk.http.SdkHttpFullRequest; -import software.amazon.awssdk.http.SdkHttpMethod; -import software.amazon.awssdk.http.SdkHttpRequest; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.S3Configuration; import software.amazon.awssdk.services.s3.internal.ConfiguredS3SdkHttpRequest; import software.amazon.awssdk.services.s3.model.CreateBucketRequest; import software.amazon.awssdk.services.s3.model.DeleteBucketRequest; import software.amazon.awssdk.services.s3.model.ListBucketsRequest; -import software.amazon.awssdk.services.s3.model.ListObjectsV2Request; import software.amazon.awssdk.services.s3.model.PutObjectRequest; import software.amazon.awssdk.services.s3.utils.InterceptorTestUtils; @@ -38,7 +34,7 @@ public class S3BucketEndpointResolverTest { S3BucketEndpointResolver endpointResolver; - @Before + @BeforeEach public void setUp() throws Exception { endpointResolver = S3BucketEndpointResolver.create(); } diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointResolverContextTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointResolverContextTest.java index 33d145fa6cbb..91110a0c02ff 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointResolverContextTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointResolverContextTest.java @@ -21,7 +21,7 @@ import static org.junit.Assert.assertTrue; import java.net.URI; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.http.SdkHttpFullRequest; import software.amazon.awssdk.http.SdkHttpMethod; import software.amazon.awssdk.regions.Region; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointResolverFactoryTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointResolverFactoryTest.java index fd994df2a822..7ef14deeace3 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointResolverFactoryTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointResolverFactoryTest.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.services.s3.model.S3Request; import software.amazon.awssdk.services.s3.model.WriteGetObjectResponseRequest; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointUtilsTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointUtilsTest.java index 7638d473670b..8cf7e7c7a8ed 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointUtilsTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3EndpointUtilsTest.java @@ -20,7 +20,7 @@ import static org.junit.Assert.assertTrue; import java.net.URI; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.http.SdkHttpFullRequest; import software.amazon.awssdk.http.SdkHttpRequest; import software.amazon.awssdk.services.s3.S3Configuration; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3ObjectLambdaOperationEndpointBuilderTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3ObjectLambdaOperationEndpointBuilderTest.java index e90ee736b93d..ecfabefeea57 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3ObjectLambdaOperationEndpointBuilderTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3ObjectLambdaOperationEndpointBuilderTest.java @@ -4,7 +4,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import java.net.URI; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; public class S3ObjectLambdaOperationEndpointBuilderTest { diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3ObjectLambdaOperationEndpointResolverTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3ObjectLambdaOperationEndpointResolverTest.java index 16689406db95..a9838219a152 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3ObjectLambdaOperationEndpointResolverTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/endpoints/S3ObjectLambdaOperationEndpointResolverTest.java @@ -22,9 +22,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.http.SdkHttpMethod; import software.amazon.awssdk.http.SdkHttpRequest; import software.amazon.awssdk.regions.Region; @@ -39,7 +39,7 @@ public class S3ObjectLambdaOperationEndpointResolverTest { private S3ObjectLambdaOperationEndpointResolver endpointResolver; - @Before + @BeforeEach public void setUp() { endpointResolver = S3ObjectLambdaOperationEndpointResolver.create(); } @@ -113,7 +113,7 @@ public void writeGetObjectResponse_endpointOverridden_shouldConvertEndpoint() { } @Test - @Ignore // TODO: Taken from the SEP but this test case is suspect. The SEP + @Disabled // TODO: Taken from the SEP but this test case is suspect. The SEP // expects s3-external-1 to be translated to the us-east-1 region for this // operation, which is weird. Currently, we do not do this. 's3-external-1' // doesn't exist in endpoints.json, so we use heuristics to get the @@ -131,7 +131,7 @@ public void writeGetObjectResponse_regionIsS3External_shouldConvertEndpoint() { } @Test - @Ignore // TODO: Taken from the SEP but this test case is suspect. The SEP + @Disabled // TODO: Taken from the SEP but this test case is suspect. The SEP // expects aws-global to be translated to the us-east-1 region for this // operation, which is weird. We do not do this; we lookup the endpoint // from the region metadata which maps aws-global => s3.amazonaws.com, so @@ -149,7 +149,7 @@ public void writeGetObjectResponse_regionIsAwsGlobal_shouldConvertEndpoint() { } @Test - @Ignore // SDK doesn't resolve fips endpoints correctly + @Disabled // SDK doesn't resolve fips endpoints correctly public void writeGetObjectResponse_regionIsFipsInPrefix_shouldConvertEndpoint() { String requestRoute = "route"; String region = "fips-us-gov-east-1"; @@ -163,7 +163,7 @@ public void writeGetObjectResponse_regionIsFipsInPrefix_shouldConvertEndpoint() } @Test - @Ignore // SDK doesn't resolve fips endpoints correctly + @Disabled // SDK doesn't resolve fips endpoints correctly public void writeGetObjectResponse_regionIsFipsInSuffix_shouldConvertEndpoint() { String requestRoute = "route"; String region = "us-gov-east-1-fips"; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/AsyncChecksumValidationInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/AsyncChecksumValidationInterceptorTest.java index b8376597ca9f..2a7de50d0346 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/AsyncChecksumValidationInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/AsyncChecksumValidationInterceptorTest.java @@ -32,7 +32,7 @@ import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import software.amazon.awssdk.core.async.AsyncRequestBody; import software.amazon.awssdk.core.checksums.Md5Checksum; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/CreateBucketInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/CreateBucketInterceptorTest.java index cf9f5014e351..005a6a81cc64 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/CreateBucketInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/CreateBucketInterceptorTest.java @@ -16,11 +16,9 @@ import static org.assertj.core.api.Assertions.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.awscore.AwsExecutionAttribute; import software.amazon.awssdk.core.SdkRequest; -import software.amazon.awssdk.core.async.AsyncRequestBody; -import software.amazon.awssdk.core.async.AsyncResponseTransformer; import software.amazon.awssdk.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.regions.Region; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/CreateMultipartUploadRequestInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/CreateMultipartUploadRequestInterceptorTest.java index 586e62fa11e9..cbd72c123fbf 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/CreateMultipartUploadRequestInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/CreateMultipartUploadRequestInterceptorTest.java @@ -22,7 +22,7 @@ import java.util.Collections; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.core.sync.RequestBody; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/DecodeUrlEncodedResponseInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/DecodeUrlEncodedResponseInterceptorTest.java index 7f5a32dcae17..61b67af6ede2 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/DecodeUrlEncodedResponseInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/DecodeUrlEncodedResponseInterceptorTest.java @@ -23,7 +23,7 @@ import java.util.List; import java.util.Optional; import java.util.function.Supplier; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import software.amazon.awssdk.core.SdkRequest; import software.amazon.awssdk.core.SdkResponse; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EnableChunkedEncodingInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EnableChunkedEncodingInterceptorTest.java index 4f03921cbb69..335d5d364b59 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EnableChunkedEncodingInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EnableChunkedEncodingInterceptorTest.java @@ -21,7 +21,7 @@ import java.net.URI; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkRequest; import software.amazon.awssdk.core.async.AsyncRequestBody; import software.amazon.awssdk.core.interceptor.Context; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EnableTrailingChecksumInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EnableTrailingChecksumInterceptorTest.java index 400e20761b6f..039e8be2569e 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EnableTrailingChecksumInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EnableTrailingChecksumInterceptorTest.java @@ -23,7 +23,7 @@ import static software.amazon.awssdk.services.s3.utils.InterceptorTestUtils.modifyHttpRequestContext; import static software.amazon.awssdk.services.s3.utils.InterceptorTestUtils.modifyResponseContext; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.signer.AwsSignerExecutionAttribute; import software.amazon.awssdk.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EndpointAddressInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EndpointAddressInterceptorTest.java index 04351a53e8bb..5d8518ca2890 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EndpointAddressInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/EndpointAddressInterceptorTest.java @@ -24,9 +24,8 @@ import static software.amazon.awssdk.utils.http.SdkHttpUtils.urlEncode; import java.net.URI; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; @@ -50,7 +49,7 @@ public class EndpointAddressInterceptorTest { private EndpointAddressInterceptor interceptor; - @Before + @BeforeEach public void setUp() throws Exception { interceptor = new EndpointAddressInterceptor(); } diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/ExceptionTranslationInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/ExceptionTranslationInterceptorTest.java index b93b6b26851c..3b7a82c34d97 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/ExceptionTranslationInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/ExceptionTranslationInterceptorTest.java @@ -19,8 +19,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.awscore.exception.AwsErrorDetails; import software.amazon.awssdk.core.SdkRequest; import software.amazon.awssdk.core.interceptor.Context; @@ -39,7 +39,7 @@ public class ExceptionTranslationInterceptorTest { private static ExceptionTranslationInterceptor interceptor; - @BeforeClass + @BeforeAll public static void setup() { interceptor = new ExceptionTranslationInterceptor(); } diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/GetBucketPolicyInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/GetBucketPolicyInterceptorTest.java index 95ee7178e58f..207b041a9fee 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/GetBucketPolicyInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/GetBucketPolicyInterceptorTest.java @@ -20,7 +20,7 @@ import java.io.InputStream; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.http.SdkHttpResponse; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/PutObjectHeaderTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/PutObjectHeaderTest.java index 0203649a477c..6152f350283c 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/PutObjectHeaderTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/PutObjectHeaderTest.java @@ -32,9 +32,9 @@ import java.io.File; import java.io.IOException; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.internal.util.Mimetype; @@ -55,7 +55,7 @@ public class PutObjectHeaderTest { private PutObjectRequest putObjectRequest; - @Before + @BeforeEach public void setup() { s3Client = S3Client.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/PutObjectInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/PutObjectInterceptorTest.java index 13bc671086b1..08dce580bc95 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/PutObjectInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/PutObjectInterceptorTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static software.amazon.awssdk.services.s3.utils.InterceptorTestUtils.modifyHttpRequestContext; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.http.SdkHttpRequest; import software.amazon.awssdk.services.s3.model.GetObjectRequest; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/SignerOverrideInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/SignerOverrideInterceptorTest.java index f258d69b8fc9..c80ecbac40c1 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/SignerOverrideInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/SignerOverrideInterceptorTest.java @@ -20,7 +20,7 @@ import java.net.URI; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.signer.AwsS3V4Signer; import software.amazon.awssdk.authcrt.signer.internal.DefaultAwsCrtS3V4aSigner; import software.amazon.awssdk.core.SdkRequest; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/SyncChecksumValidationInterceptorTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/SyncChecksumValidationInterceptorTest.java index 90b779cdfd25..6145b1867863 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/SyncChecksumValidationInterceptorTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/handlers/SyncChecksumValidationInterceptorTest.java @@ -36,7 +36,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.checksums.Md5Checksum; import software.amazon.awssdk.core.checksums.SdkChecksum; import software.amazon.awssdk.core.interceptor.Context; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/MultiRegionAccessPointEndpointResolutionTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/MultiRegionAccessPointEndpointResolutionTest.java index 1fd0157e90d6..5e996a34f0c5 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/MultiRegionAccessPointEndpointResolutionTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/MultiRegionAccessPointEndpointResolutionTest.java @@ -20,8 +20,8 @@ import static software.amazon.awssdk.services.s3.S3MockUtils.mockListObjectsResponse; import java.net.URI; -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.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.http.SdkHttpRequest; @@ -43,7 +43,7 @@ public class MultiRegionAccessPointEndpointResolutionTest { URI.create("https://mfzwi23gnjvgw.mrap.accesspoint.s3-global.amazonaws.com"); private MockHttpClient mockHttpClient; - @Before + @BeforeEach public void setup() { mockHttpClient = new MockSyncHttpClient(); } diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/OutpostAccessPointArnEndpointResolutionTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/OutpostAccessPointArnEndpointResolutionTest.java index af1a35e9bc73..c64b3106e7ef 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/OutpostAccessPointArnEndpointResolutionTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/OutpostAccessPointArnEndpointResolutionTest.java @@ -21,8 +21,8 @@ import static software.amazon.awssdk.services.s3.S3MockUtils.mockListObjectsResponse; import java.net.URI; -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.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.signer.Signer; @@ -42,7 +42,7 @@ public class OutpostAccessPointArnEndpointResolutionTest { private MockSyncHttpClient mockHttpClient; private Signer mockSigner; - @Before + @BeforeEach public void setup() { mockHttpClient = new MockSyncHttpClient(); mockSigner = (request, executionAttributes) -> request; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3AccessPointBuilderTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3AccessPointBuilderTest.java index 5bfdf2ddbd19..f7afc2fdb106 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3AccessPointBuilderTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3AccessPointBuilderTest.java @@ -21,7 +21,7 @@ import java.net.URI; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; public class S3AccessPointBuilderTest { diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ArnConverterTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ArnConverterTest.java index e786dd1d527a..9e17e1f56b10 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ArnConverterTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ArnConverterTest.java @@ -22,7 +22,7 @@ import java.util.Optional; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.arns.Arn; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ArnUtilsTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ArnUtilsTest.java index b5159aa8bd35..416a3459f40c 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ArnUtilsTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ArnUtilsTest.java @@ -22,7 +22,7 @@ import java.util.Optional; import java.util.UUID; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.arns.Arn; import software.amazon.awssdk.arns.ArnResource; diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectLambdaEndpointResolutionTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectLambdaEndpointResolutionTest.java index d78200c9f128..37a54f879a6f 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectLambdaEndpointResolutionTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectLambdaEndpointResolutionTest.java @@ -21,8 +21,8 @@ import java.io.UnsupportedEncodingException; import java.net.URI; -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.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.http.SdkHttpRequest; @@ -37,7 +37,7 @@ public class S3ObjectLambdaEndpointResolutionTest { private MockSyncHttpClient mockHttpClient; - @Before + @BeforeEach public void setup() throws UnsupportedEncodingException { mockHttpClient = new MockSyncHttpClient(); mockHttpClient.stubNextResponse(mockListObjectsResponse()); diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectLambdaResourceTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectLambdaResourceTest.java index 12f972a20bb2..5b0ae48912f0 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectLambdaResourceTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectLambdaResourceTest.java @@ -22,7 +22,7 @@ import static org.hamcrest.CoreMatchers.not; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; /** diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectResourceTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectResourceTest.java index 127488e831c7..b41e4dd9231d 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectResourceTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/resource/S3ObjectResourceTest.java @@ -21,7 +21,7 @@ import java.util.Optional; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; public class S3ObjectResourceTest { diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/DisableMultiRegionProviderChainTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/DisableMultiRegionProviderChainTest.java index f4454dd3b2c7..f2cd9efb87ad 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/DisableMultiRegionProviderChainTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/DisableMultiRegionProviderChainTest.java @@ -20,14 +20,14 @@ import static software.amazon.awssdk.services.s3.S3SystemSetting.AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS; import java.util.Optional; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.testutils.EnvironmentVariableHelper; public class DisableMultiRegionProviderChainTest { private final EnvironmentVariableHelper helper = new EnvironmentVariableHelper(); - @After + @AfterEach public void clearSystemProperty() { System.clearProperty(AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS.property()); System.clearProperty(AWS_CONFIG_FILE.property()); diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/ProfileDisableMultiRegionProviderTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/ProfileDisableMultiRegionProviderTest.java index daa05abe58f8..5169ac9a11e4 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/ProfileDisableMultiRegionProviderTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/ProfileDisableMultiRegionProviderTest.java @@ -22,8 +22,8 @@ import static software.amazon.awssdk.profiles.ProfileFileSystemSetting.AWS_CONFIG_FILE; import java.util.Optional; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider; @@ -38,7 +38,7 @@ public class ProfileDisableMultiRegionProviderTest { private ProfileDisableMultiRegionProvider provider = ProfileDisableMultiRegionProvider.create(); - @After + @AfterEach public void clearSystemProperty() { System.clearProperty(AWS_CONFIG_FILE.property()); } diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/ProfileUseArnRegionProviderTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/ProfileUseArnRegionProviderTest.java index 85e4c026b1ae..f2b8e98bdc0f 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/ProfileUseArnRegionProviderTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/ProfileUseArnRegionProviderTest.java @@ -23,8 +23,8 @@ import static software.amazon.awssdk.profiles.ProfileFileSystemSetting.AWS_CONFIG_FILE; import java.util.Optional; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider; @@ -39,7 +39,7 @@ public class ProfileUseArnRegionProviderTest { private ProfileUseArnRegionProvider provider = ProfileUseArnRegionProvider.create(); - @After + @AfterEach public void clearSystemProperty() { System.clearProperty(AWS_CONFIG_FILE.property()); } diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/SystemSettingsDisableMultiRegionProviderTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/SystemSettingsDisableMultiRegionProviderTest.java index b2895388e7f7..da8f39bb1738 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/SystemSettingsDisableMultiRegionProviderTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/SystemSettingsDisableMultiRegionProviderTest.java @@ -22,15 +22,15 @@ import static software.amazon.awssdk.services.s3.S3SystemSetting.AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS; import java.util.Optional; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.testutils.EnvironmentVariableHelper; public class SystemSettingsDisableMultiRegionProviderTest { private final SystemsSettingsDisableMultiRegionProvider provider = SystemsSettingsDisableMultiRegionProvider.create(); private final EnvironmentVariableHelper helper = new EnvironmentVariableHelper(); - @After + @AfterEach public void clearSystemProperty() { System.clearProperty(AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS.property()); helper.reset(); diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/SystemSettingsUseArnRegionProviderTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/SystemSettingsUseArnRegionProviderTest.java index 9639eec9dbda..1c8ffd7e8d91 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/SystemSettingsUseArnRegionProviderTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/SystemSettingsUseArnRegionProviderTest.java @@ -22,15 +22,15 @@ import static software.amazon.awssdk.services.s3.S3SystemSetting.AWS_S3_USE_ARN_REGION; import java.util.Optional; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.testutils.EnvironmentVariableHelper; public class SystemSettingsUseArnRegionProviderTest { private final SystemsSettingsUseArnRegionProvider provider = SystemsSettingsUseArnRegionProvider.create(); private final EnvironmentVariableHelper helper = new EnvironmentVariableHelper(); - @After + @AfterEach public void clearSystemProperty() { System.clearProperty(AWS_S3_USE_ARN_REGION.property()); helper.reset(); diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/UseArnRegionProviderChainTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/UseArnRegionProviderChainTest.java index 6e8d72ac17e1..5f1e72b77492 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/UseArnRegionProviderChainTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/internal/settingproviders/UseArnRegionProviderChainTest.java @@ -20,14 +20,14 @@ import static software.amazon.awssdk.services.s3.S3SystemSetting.AWS_S3_USE_ARN_REGION; import java.util.Optional; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.testutils.EnvironmentVariableHelper; public class UseArnRegionProviderChainTest { private final EnvironmentVariableHelper helper = new EnvironmentVariableHelper(); - @After + @AfterEach public void clearSystemProperty() { System.clearProperty(AWS_S3_USE_ARN_REGION.property()); System.clearProperty(AWS_CONFIG_FILE.property()); diff --git a/services/s3/src/test/java/software/amazon/awssdk/services/s3/presigner/model/GetObjectPresignRequestTest.java b/services/s3/src/test/java/software/amazon/awssdk/services/s3/presigner/model/GetObjectPresignRequestTest.java index 4436e66cd8b7..59265d4e33cb 100644 --- a/services/s3/src/test/java/software/amazon/awssdk/services/s3/presigner/model/GetObjectPresignRequestTest.java +++ b/services/s3/src/test/java/software/amazon/awssdk/services/s3/presigner/model/GetObjectPresignRequestTest.java @@ -19,7 +19,7 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; import java.time.Duration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.s3.model.GetObjectRequest; public class GetObjectPresignRequestTest { diff --git a/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3AccessPointsIntegrationTest.java b/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3AccessPointsIntegrationTest.java index ef5feb77f8f2..597bedbfc2b3 100644 --- a/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3AccessPointsIntegrationTest.java +++ b/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3AccessPointsIntegrationTest.java @@ -22,9 +22,9 @@ import java.io.IOException; import java.time.Duration; import java.util.StringJoiner; -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.core.sync.RequestBody; import software.amazon.awssdk.http.HttpExecuteRequest; import software.amazon.awssdk.http.HttpExecuteResponse; @@ -54,7 +54,7 @@ public class S3AccessPointsIntegrationTest extends S3ControlIntegrationTestBase private static String accountId; - @BeforeClass + @BeforeAll public static void setupFixture() { createBucket(BUCKET); @@ -74,7 +74,7 @@ public static void setupFixture() { .name(AP_NAME)); } - @AfterClass + @AfterAll public static void tearDown() { s3control.deleteAccessPoint(b -> b.accountId(accountId).name(AP_NAME)); deleteBucketAndAllContents(BUCKET); diff --git a/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3AsyncAccessPointsIntegrationTest.java b/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3AsyncAccessPointsIntegrationTest.java index 3d4cafaa0031..8c0c42b572ef 100644 --- a/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3AsyncAccessPointsIntegrationTest.java +++ b/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3AsyncAccessPointsIntegrationTest.java @@ -19,9 +19,9 @@ import static software.amazon.awssdk.testutils.service.S3BucketUtils.temporaryBucketName; import java.util.StringJoiner; -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.core.sync.RequestBody; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3.model.GetObjectRequest; @@ -42,7 +42,7 @@ public class S3AsyncAccessPointsIntegrationTest extends S3ControlIntegrationTest private static String accountId; - @BeforeClass + @BeforeAll public static void setupFixture() { createBucket(BUCKET); @@ -63,7 +63,7 @@ public static void setupFixture() { .join(); } - @AfterClass + @AfterAll public static void tearDown() { s3control.deleteAccessPoint(b -> b.accountId(accountId).name(AP_NAME)).join(); deleteBucketAndAllContents(BUCKET); diff --git a/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3ControlIntegrationTest.java b/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3ControlIntegrationTest.java index 4ef0ae260c80..0739cf6955ae 100644 --- a/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3ControlIntegrationTest.java +++ b/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3ControlIntegrationTest.java @@ -19,9 +19,9 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -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 software.amazon.awssdk.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.core.interceptor.ExecutionInterceptor; @@ -42,7 +42,7 @@ public class S3ControlIntegrationTest extends AwsIntegrationTestBase { private S3ControlClient client; - @Before + @BeforeEach public void setup() { StsClient sts = StsClient.create(); accountId = sts.getCallerIdentity().account(); @@ -51,7 +51,7 @@ public void setup() { .build(); } - @After + @AfterEach public void tearDown() { try { client.deletePublicAccessBlock(DeletePublicAccessBlockRequest.builder().accountId(accountId).build()); diff --git a/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3ControlIntegrationTestBase.java b/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3ControlIntegrationTestBase.java index 35f387236166..e940f28a4a19 100644 --- a/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3ControlIntegrationTestBase.java +++ b/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3ControlIntegrationTestBase.java @@ -19,7 +19,7 @@ import java.util.Iterator; import java.util.List; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.core.ClientType; import software.amazon.awssdk.core.interceptor.Context; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; @@ -67,7 +67,7 @@ public class S3ControlIntegrationTestBase extends AwsTestBase { * Loads the AWS account info for the integration tests and creates an S3 * client for tests to use. */ - @BeforeClass + @BeforeAll public static void setUp() throws Exception { s3 = s3ClientBuilder().build(); s3Async = s3AsyncClientBuilder().build(); diff --git a/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3MrapIntegrationTest.java b/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3MrapIntegrationTest.java index d0abe039aef7..49ec5eb3e5f1 100644 --- a/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3MrapIntegrationTest.java +++ b/services/s3control/src/it/java/software.amazon.awssdk.services.s3control/S3MrapIntegrationTest.java @@ -26,8 +26,8 @@ import java.util.Collections; import java.util.List; import java.util.Optional; -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.signer.S3SignerExecutionAttribute; import software.amazon.awssdk.auth.signer.internal.SignerConstant; import software.amazon.awssdk.awscore.presigner.PresignedRequest; @@ -87,7 +87,7 @@ public class S3MrapIntegrationTest extends S3ControlIntegrationTestBase { private static StsClient stsClient; private static S3Client s3Client; - @BeforeClass + @BeforeAll public static void setupFixture() { captureInterceptor = new CaptureRequestInterceptor(); diff --git a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/S3ControlArnConverterTest.java b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/S3ControlArnConverterTest.java index 9ec15936be18..101f828b87c8 100644 --- a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/S3ControlArnConverterTest.java +++ b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/S3ControlArnConverterTest.java @@ -21,7 +21,7 @@ import java.util.Optional; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.arns.Arn; import software.amazon.awssdk.services.s3.internal.resource.S3AccessPointResource; diff --git a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/S3ControlWireMockTest.java b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/S3ControlWireMockTest.java index 78aa57674f78..7bb7043a4657 100644 --- a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/S3ControlWireMockTest.java +++ b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/S3ControlWireMockTest.java @@ -19,9 +19,9 @@ import com.github.tomakehurst.wiremock.core.WireMockConfiguration; import com.github.tomakehurst.wiremock.junit.WireMockRule; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3control.S3ControlClient; @@ -34,7 +34,7 @@ public class S3ControlWireMockTest { private S3ControlClient client; - @Before + @BeforeEach public void setup() { client = S3ControlClient.builder() .region(Region.US_WEST_2) diff --git a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/NonArnOutpostRequestTest.java b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/NonArnOutpostRequestTest.java index 12534ca47bbe..fd8cd7a9ccc5 100644 --- a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/NonArnOutpostRequestTest.java +++ b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/NonArnOutpostRequestTest.java @@ -28,8 +28,8 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3control.S3ControlClient; @@ -38,7 +38,7 @@ public class NonArnOutpostRequestTest extends S3ControlWireMockTestBase { private S3ControlClient s3; private static final String EXPECTED_URL = "/v20180820/bucket"; - @Before + @BeforeEach public void methodSetUp() { s3 = buildClient(); } diff --git a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3AccessPointArnTest.java b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3AccessPointArnTest.java index feecaf13f5a8..f043a44ca3db 100644 --- a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3AccessPointArnTest.java +++ b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3AccessPointArnTest.java @@ -15,9 +15,9 @@ package software.amazon.awssdk.services.s3control.internal.functionaltests.arns; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3control.S3ControlClient; @@ -29,7 +29,7 @@ public class S3AccessPointArnTest extends S3ControlWireMockTestBase { @Rule public ExpectedException exception = ExpectedException.none(); - @Before + @BeforeEach public void methodSetUp() { s3Control = buildClient(); } diff --git a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3OutpostAccessPointArnTest.java b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3OutpostAccessPointArnTest.java index ea4c09162b84..0db2ddb52f1a 100644 --- a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3OutpostAccessPointArnTest.java +++ b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3OutpostAccessPointArnTest.java @@ -23,9 +23,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3control.S3ControlClient; @@ -38,7 +38,7 @@ public class S3OutpostAccessPointArnTest extends S3ControlWireMockTestBase { @Rule public ExpectedException exception = ExpectedException.none(); - @Before + @BeforeEach public void methodSetUp() { s3 = buildClient(); } diff --git a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3OutpostBucketArnTest.java b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3OutpostBucketArnTest.java index f41f0d0b3932..2649e23e7fdc 100644 --- a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3OutpostBucketArnTest.java +++ b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/arns/S3OutpostBucketArnTest.java @@ -28,9 +28,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.s3control.S3ControlClient; @@ -43,7 +43,7 @@ public class S3OutpostBucketArnTest extends S3ControlWireMockTestBase { private static final String EXPECTED_URL = "/v20180820/bucket/mybucket"; private static final String EXPECTED_HOST = "s3-outposts.%s.amazonaws.com"; - @Before + @BeforeEach public void methodSetUp() { s3Control = buildClient(); } diff --git a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/signing/UrlEncodingTest.java b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/signing/UrlEncodingTest.java index 38531825c08b..39e0af272a01 100644 --- a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/signing/UrlEncodingTest.java +++ b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/functionaltests/signing/UrlEncodingTest.java @@ -19,14 +19,13 @@ import static com.github.tomakehurst.wiremock.client.WireMock.get; import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; -import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; import static org.assertj.core.api.Assertions.assertThat; import java.net.URI; import com.github.tomakehurst.wiremock.junit.WireMockRule; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.signer.AwsSignerExecutionAttribute; import software.amazon.awssdk.core.interceptor.Context; @@ -57,7 +56,7 @@ protected S3ControlClient buildClient() { .build(); } - @Before + @BeforeEach public void methodSetUp() { s3Control = buildClient(); } diff --git a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/interceptors/PayloadSigningInterceptorTest.java b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/interceptors/PayloadSigningInterceptorTest.java index f64cb21f188a..a7acddb6e4ab 100644 --- a/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/interceptors/PayloadSigningInterceptorTest.java +++ b/services/s3control/src/test/java/software/amazon/awssdk/services/s3control/internal/interceptors/PayloadSigningInterceptorTest.java @@ -17,8 +17,8 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.Optional; -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.S3SignerExecutionAttribute; import software.amazon.awssdk.core.Protocol; import software.amazon.awssdk.core.SdkRequest; @@ -35,7 +35,7 @@ public class PayloadSigningInterceptorTest { private SdkHttpRequest request; - @Before + @BeforeEach public void setup() { request = SdkHttpFullRequest.builder() .protocol(Protocol.HTTPS.toString()) diff --git a/services/servicecatalog/src/it/java/software/amazon/awssdk/services/servicecatalog/ServiceCatalogIntegrationTest.java b/services/servicecatalog/src/it/java/software/amazon/awssdk/services/servicecatalog/ServiceCatalogIntegrationTest.java index 701f0e4e0ebb..a8c17c9d4f91 100644 --- a/services/servicecatalog/src/it/java/software/amazon/awssdk/services/servicecatalog/ServiceCatalogIntegrationTest.java +++ b/services/servicecatalog/src/it/java/software/amazon/awssdk/services/servicecatalog/ServiceCatalogIntegrationTest.java @@ -17,8 +17,8 @@ import java.util.List; import junit.framework.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.servicecatalog.model.ListRecordHistoryRequest; import software.amazon.awssdk.services.servicecatalog.model.RecordDetail; import software.amazon.awssdk.testutils.service.AwsIntegrationTestBase; @@ -27,7 +27,7 @@ public class ServiceCatalogIntegrationTest extends AwsIntegrationTestBase { private static ServiceCatalogClient serviceCatalog; - @Before + @BeforeEach public void setUp() throws Exception { serviceCatalog = ServiceCatalogClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); } diff --git a/services/ses/src/it/java/software/amazon/awssdk/services/ses/IntegrationTestBase.java b/services/ses/src/it/java/software/amazon/awssdk/services/ses/IntegrationTestBase.java index 0823dde2c4a7..1aa59a78ee4a 100644 --- a/services/ses/src/it/java/software/amazon/awssdk/services/ses/IntegrationTestBase.java +++ b/services/ses/src/it/java/software/amazon/awssdk/services/ses/IntegrationTestBase.java @@ -21,7 +21,7 @@ import java.io.IOException; import java.io.InputStream; import org.apache.commons.io.IOUtils; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.services.ses.model.ListVerifiedEmailAddressesRequest; import software.amazon.awssdk.services.ses.model.ListVerifiedEmailAddressesResponse; import software.amazon.awssdk.services.ses.model.VerifyEmailAddressRequest; @@ -43,7 +43,7 @@ public abstract class IntegrationTestBase extends AwsTestBase { * Loads the AWS account info for the integration tests and creates client objects for tests to * use. */ - @BeforeClass + @BeforeAll public static void setUp() throws FileNotFoundException, IOException { setUpCredentials(); diff --git a/services/sfn/src/it/java/software/amazon/awssdk/services/sfn/SfnIntegrationTest.java b/services/sfn/src/it/java/software/amazon/awssdk/services/sfn/SfnIntegrationTest.java index 153d5d5f7587..5c213bc7efa5 100644 --- a/services/sfn/src/it/java/software/amazon/awssdk/services/sfn/SfnIntegrationTest.java +++ b/services/sfn/src/it/java/software/amazon/awssdk/services/sfn/SfnIntegrationTest.java @@ -17,9 +17,9 @@ import static org.junit.Assert.assertNotNull; -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.testutils.service.AwsIntegrationTestBase; public class SfnIntegrationTest extends AwsIntegrationTestBase { @@ -27,13 +27,13 @@ public class SfnIntegrationTest extends AwsIntegrationTestBase { private static SfnClient sfnClient; private static String activityArn; - @BeforeClass + @BeforeAll public static void setUpClient() { sfnClient = SfnClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); activityArn = sfnClient.createActivity(b -> b.name("test")).activityArn(); } - @AfterClass + @AfterAll public static void cleanUp() { if (activityArn != null) { sfnClient.deleteActivity(b -> b.activityArn(activityArn)); diff --git a/services/sns/src/it/java/software/amazon/awssdk/core/auth/policy/SnsPolicyIntegrationTest.java b/services/sns/src/it/java/software/amazon/awssdk/core/auth/policy/SnsPolicyIntegrationTest.java index 28be0c3e7858..790e9fc34a8e 100644 --- a/services/sns/src/it/java/software/amazon/awssdk/core/auth/policy/SnsPolicyIntegrationTest.java +++ b/services/sns/src/it/java/software/amazon/awssdk/core/auth/policy/SnsPolicyIntegrationTest.java @@ -15,8 +15,8 @@ package software.amazon.awssdk.core.auth.policy; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.auth.policy.Statement.Effect; import software.amazon.awssdk.core.auth.policy.conditions.StringCondition; import software.amazon.awssdk.core.auth.policy.conditions.StringCondition.StringComparisonType; @@ -34,7 +34,7 @@ public class SnsPolicyIntegrationTest extends IntegrationTestBase { /** * Releases all test resources. */ - @After + @AfterEach public void tearDown() throws Exception { sns.deleteTopic(DeleteTopicRequest.builder().topicArn(topicArn).build()); } diff --git a/services/sns/src/it/java/software/amazon/awssdk/services/sns/IntegrationTestBase.java b/services/sns/src/it/java/software/amazon/awssdk/services/sns/IntegrationTestBase.java index b73c549aa4de..a09c8814d534 100644 --- a/services/sns/src/it/java/software/amazon/awssdk/services/sns/IntegrationTestBase.java +++ b/services/sns/src/it/java/software/amazon/awssdk/services/sns/IntegrationTestBase.java @@ -26,7 +26,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.sns.model.Subscription; @@ -47,7 +47,7 @@ public abstract class IntegrationTestBase extends AwsIntegrationTestBase { * Loads the AWS account info for the integration tests and creates SNS and SQS clients for * tests to use. */ - @BeforeClass + @BeforeAll public static void setUp() throws FileNotFoundException, IOException { sns = SnsClient.builder() .credentialsProvider(StaticCredentialsProvider.create(getCredentials())) diff --git a/services/sns/src/it/java/software/amazon/awssdk/services/sns/SNSIntegrationTest.java b/services/sns/src/it/java/software/amazon/awssdk/services/sns/SNSIntegrationTest.java index d1f9ab38154a..13d3525cc328 100644 --- a/services/sns/src/it/java/software/amazon/awssdk/services/sns/SNSIntegrationTest.java +++ b/services/sns/src/it/java/software/amazon/awssdk/services/sns/SNSIntegrationTest.java @@ -34,11 +34,10 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -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 software.amazon.awssdk.awscore.exception.AwsServiceException; -import software.amazon.awssdk.core.exception.SdkServiceException; import software.amazon.awssdk.services.sns.model.AddPermissionRequest; import software.amazon.awssdk.services.sns.model.CreateTopicRequest; import software.amazon.awssdk.services.sns.model.CreateTopicResponse; @@ -84,7 +83,7 @@ public class SNSIntegrationTest extends IntegrationTestBase { private String queueUrl; private String subscriptionArn; - @Before + @BeforeEach public void setup() { topicArn = null; queueUrl = null; @@ -92,7 +91,7 @@ public void setup() { } /** Releases all resources used by this test. */ - @After + @AfterEach public void tearDown() throws Exception { if (topicArn != null) { sns.deleteTopic(DeleteTopicRequest.builder().topicArn(topicArn).build()); diff --git a/services/sns/src/it/java/software/amazon/awssdk/services/sns/SessionBasedAuthenticationIntegrationTest.java b/services/sns/src/it/java/software/amazon/awssdk/services/sns/SessionBasedAuthenticationIntegrationTest.java index 6c030cb0891c..d387c9a9a658 100644 --- a/services/sns/src/it/java/software/amazon/awssdk/services/sns/SessionBasedAuthenticationIntegrationTest.java +++ b/services/sns/src/it/java/software/amazon/awssdk/services/sns/SessionBasedAuthenticationIntegrationTest.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.services.sns; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.testutils.service.AwsTestBase; /** diff --git a/services/sns/src/test/java/software/amazon/awssdk/services/sns/SnsSignatureCheckerTest.java b/services/sns/src/test/java/software/amazon/awssdk/services/sns/SnsSignatureCheckerTest.java index 73a72d91aef6..386c34b46753 100644 --- a/services/sns/src/test/java/software/amazon/awssdk/services/sns/SnsSignatureCheckerTest.java +++ b/services/sns/src/test/java/software/amazon/awssdk/services/sns/SnsSignatureCheckerTest.java @@ -23,7 +23,7 @@ import java.security.cert.CertificateException; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.testutils.service.AwsTestBase; public class SnsSignatureCheckerTest extends AwsTestBase { diff --git a/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/IntegrationTestBase.java b/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/IntegrationTestBase.java index b6d7629a9497..5a6df2359054 100644 --- a/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/IntegrationTestBase.java +++ b/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/IntegrationTestBase.java @@ -20,7 +20,7 @@ import java.util.Map; import java.util.Random; import java.util.UUID; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.iam.IamClient; @@ -62,7 +62,7 @@ public class IntegrationTestBase extends AwsIntegrationTestBase { * Loads the AWS account info for the integration tests and creates an SQS client for tests to * use. */ - @Before + @BeforeEach public void setUp() { sqsAsync = createSqsAyncClient(); sqsSync = createSqsSyncClient(); diff --git a/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/MessageAttributesIntegrationTest.java b/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/MessageAttributesIntegrationTest.java index e94312d0e1f0..4a93ec183694 100644 --- a/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/MessageAttributesIntegrationTest.java +++ b/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/MessageAttributesIntegrationTest.java @@ -27,9 +27,9 @@ import java.nio.ByteBuffer; import java.util.List; import java.util.Map; -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 software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.core.SdkResponse; import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; @@ -58,12 +58,12 @@ public class MessageAttributesIntegrationTest extends IntegrationTestBase { private String queueUrl; - @Before + @BeforeEach public void setup() { queueUrl = createQueue(sqsAsync); } - @After + @AfterEach public void tearDown() throws Exception { sqsAsync.deleteQueue(DeleteQueueRequest.builder().queueUrl(queueUrl).build()); } diff --git a/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/SqsConcurrentPerformanceIntegrationTest.java b/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/SqsConcurrentPerformanceIntegrationTest.java index 605adab6a221..c55dda74c01a 100644 --- a/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/SqsConcurrentPerformanceIntegrationTest.java +++ b/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/SqsConcurrentPerformanceIntegrationTest.java @@ -20,8 +20,8 @@ import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.sqs.model.ListQueuesRequest; /** @@ -46,7 +46,7 @@ public class SqsConcurrentPerformanceIntegrationTest extends IntegrationTestBase * that they don't sit around in CLOSE_WAIT, and are correctly being reaped. */ @Test - @Ignore + @Disabled public void testIdleConnectionReaping() throws Exception { sqs = SqsAsyncClient.builder().credentialsProvider(getCredentialsProvider()).build(); sqs = SqsAsyncClient.builder().credentialsProvider(getCredentialsProvider()).build(); diff --git a/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/SqsIntegrationTest.java b/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/SqsIntegrationTest.java index 1db8566cc12a..4dae827868d7 100644 --- a/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/SqsIntegrationTest.java +++ b/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/SqsIntegrationTest.java @@ -20,7 +20,7 @@ import static org.junit.Assert.assertThat; import org.apache.log4j.BasicConfigurator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkGlobalTime; import software.amazon.awssdk.services.sqs.model.ListQueuesRequest; diff --git a/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/auth/policy/SqsPolicyIntegrationTest.java b/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/auth/policy/SqsPolicyIntegrationTest.java index 6eeb642a4233..ac25b2843f32 100644 --- a/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/auth/policy/SqsPolicyIntegrationTest.java +++ b/services/sqs/src/it/java/software/amazon/awssdk/services/sqs/auth/policy/SqsPolicyIntegrationTest.java @@ -18,8 +18,8 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.auth.policy.Action; import software.amazon.awssdk.core.auth.policy.Policy; import software.amazon.awssdk.core.auth.policy.Principal; @@ -47,7 +47,7 @@ public class SqsPolicyIntegrationTest extends IntegrationTestBase { /** * Releases all test resources */ - @After + @AfterEach public void tearDown() throws Exception { sqsSync.deleteQueue(DeleteQueueRequest.builder().queueUrl(queueUrl).build()); } diff --git a/services/sqs/src/test/java/software/amazon/awssdk/services/sqs/MessageMD5ChecksumInterceptorTest.java b/services/sqs/src/test/java/software/amazon/awssdk/services/sqs/MessageMD5ChecksumInterceptorTest.java index 683ef2975c4c..d7e8a123755e 100644 --- a/services/sqs/src/test/java/software/amazon/awssdk/services/sqs/MessageMD5ChecksumInterceptorTest.java +++ b/services/sqs/src/test/java/software/amazon/awssdk/services/sqs/MessageMD5ChecksumInterceptorTest.java @@ -19,7 +19,7 @@ import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.core.SdkRequest; import software.amazon.awssdk.core.SdkResponse; diff --git a/services/ssm/src/it/java/software/amazon/awssdk/services/ssm/IntegrationTestBase.java b/services/ssm/src/it/java/software/amazon/awssdk/services/ssm/IntegrationTestBase.java index af6423c26d36..3d96476e0de3 100644 --- a/services/ssm/src/it/java/software/amazon/awssdk/services/ssm/IntegrationTestBase.java +++ b/services/ssm/src/it/java/software/amazon/awssdk/services/ssm/IntegrationTestBase.java @@ -15,14 +15,14 @@ package software.amazon.awssdk.services.ssm; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.testutils.service.AwsTestBase; public class IntegrationTestBase extends AwsTestBase { protected static SsmClient ssm; - @BeforeClass + @BeforeAll public static void setup() throws Exception { setUpCredentials(); ssm = SsmClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); diff --git a/services/ssm/src/it/java/software/amazon/awssdk/services/ssm/SSMServiceIntegrationTest.java b/services/ssm/src/it/java/software/amazon/awssdk/services/ssm/SSMServiceIntegrationTest.java index 3753fbe8b6e7..02606109030d 100644 --- a/services/ssm/src/it/java/software/amazon/awssdk/services/ssm/SSMServiceIntegrationTest.java +++ b/services/ssm/src/it/java/software/amazon/awssdk/services/ssm/SSMServiceIntegrationTest.java @@ -19,8 +19,8 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; -import org.junit.AfterClass; -import org.junit.Test; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import software.amazon.awssdk.services.ssm.model.CreateDocumentRequest; @@ -41,7 +41,7 @@ public class SSMServiceIntegrationTest extends IntegrationTestBase { private static final String DOCUMENT_LOCATION = "documentContent.json"; private static final String DOCUMENT_NAME = "my-document-" + System.currentTimeMillis(); - @AfterClass + @AfterAll public static void tearDown() { try { ssm.deleteDocument(DeleteDocumentRequest.builder().name(DOCUMENT_NAME).build()); diff --git a/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoCredentialsProviderTest.java b/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoCredentialsProviderTest.java index 9d15a6cfc7be..98f292ddb790 100644 --- a/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoCredentialsProviderTest.java +++ b/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoCredentialsProviderTest.java @@ -24,11 +24,10 @@ import java.time.Duration; import java.time.Instant; import java.util.function.Supplier; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import software.amazon.awssdk.auth.credentials.AwsSessionCredentials; import software.amazon.awssdk.services.sso.SsoClient; -import software.amazon.awssdk.services.sso.auth.SsoCredentialsProvider; import software.amazon.awssdk.services.sso.model.GetRoleCredentialsRequest; import software.amazon.awssdk.services.sso.model.GetRoleCredentialsResponse; import software.amazon.awssdk.services.sso.model.RoleCredentials; diff --git a/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoProfileCredentialsProviderFactoryTest.java b/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoProfileCredentialsProviderFactoryTest.java index bcc47d576ccd..91c22ba3aee8 100644 --- a/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoProfileCredentialsProviderFactoryTest.java +++ b/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoProfileCredentialsProviderFactoryTest.java @@ -27,7 +27,7 @@ import java.nio.file.Path; import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; import software.amazon.awssdk.profiles.Profile; import software.amazon.awssdk.services.sso.internal.SsoAccessTokenProvider; diff --git a/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoProfileTest.java b/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoProfileTest.java index d6fd7565c8f8..b20798940de5 100644 --- a/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoProfileTest.java +++ b/services/sso/src/test/java/software/amazon/awssdk/services/sso/auth/SsoProfileTest.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.auth.credentials.internal.ProfileCredentialsUtils; import software.amazon.awssdk.profiles.ProfileFile; import software.amazon.awssdk.utils.StringInputStream; diff --git a/services/sso/src/test/java/software/amazon/awssdk/services/sso/internal/SsoAccessTokenProviderTest.java b/services/sso/src/test/java/software/amazon/awssdk/services/sso/internal/SsoAccessTokenProviderTest.java index 678bd8f129bb..7aead87d4483 100644 --- a/services/sso/src/test/java/software/amazon/awssdk/services/sso/internal/SsoAccessTokenProviderTest.java +++ b/services/sso/src/test/java/software/amazon/awssdk/services/sso/internal/SsoAccessTokenProviderTest.java @@ -27,7 +27,7 @@ import java.nio.file.FileSystem; import java.nio.file.Files; import java.nio.file.Path; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Check if the behavior of {@link SsoAccessTokenProvider} is correct while consuming different formats of cached token diff --git a/services/sso/src/test/java/software/amazon/awssdk/services/sso/internal/SsoTokenFileUtilsTest.java b/services/sso/src/test/java/software/amazon/awssdk/services/sso/internal/SsoTokenFileUtilsTest.java index 1028fa397759..8f3c0563b959 100644 --- a/services/sso/src/test/java/software/amazon/awssdk/services/sso/internal/SsoTokenFileUtilsTest.java +++ b/services/sso/src/test/java/software/amazon/awssdk/services/sso/internal/SsoTokenFileUtilsTest.java @@ -19,7 +19,7 @@ import static software.amazon.awssdk.services.sso.internal.SsoTokenFileUtils.generateCachedTokenPath; import static software.amazon.awssdk.utils.UserHomeDirectoryUtils.userHomeDirectory; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class SsoTokenFileUtilsTest { diff --git a/services/sts/src/it/java/software/amazon/awssdk/services/sts/AssumeRoleIntegrationTest.java b/services/sts/src/it/java/software/amazon/awssdk/services/sts/AssumeRoleIntegrationTest.java index c845bb770cf8..5654e1f391e5 100644 --- a/services/sts/src/it/java/software/amazon/awssdk/services/sts/AssumeRoleIntegrationTest.java +++ b/services/sts/src/it/java/software/amazon/awssdk/services/sts/AssumeRoleIntegrationTest.java @@ -21,8 +21,8 @@ import java.time.Duration; import java.util.Comparator; import java.util.Optional; -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.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider; @@ -68,7 +68,7 @@ public class AssumeRoleIntegrationTest extends IntegrationTestBaseWithIAM { private static AwsCredentials userCredentials; - @BeforeClass + @BeforeAll public static void setup() { String accountId = sts.getCallerIdentity().account(); USER_ARN = String.format(USER_ARN_FORMAT, accountId); diff --git a/services/sts/src/it/java/software/amazon/awssdk/services/sts/IntegrationTestBase.java b/services/sts/src/it/java/software/amazon/awssdk/services/sts/IntegrationTestBase.java index a83ed5a94697..f06744adaf80 100644 --- a/services/sts/src/it/java/software/amazon/awssdk/services/sts/IntegrationTestBase.java +++ b/services/sts/src/it/java/software/amazon/awssdk/services/sts/IntegrationTestBase.java @@ -17,7 +17,7 @@ import java.io.FileNotFoundException; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.testutils.service.AwsTestBase; @@ -31,7 +31,7 @@ public abstract class IntegrationTestBase extends AwsTestBase { /** The shared STS client for all tests to use. */ protected static StsClient sts; - @BeforeClass + @BeforeAll public static void setUp() throws FileNotFoundException, IOException { setUpCredentials(); sts = StsClient.builder() diff --git a/services/sts/src/it/java/software/amazon/awssdk/services/sts/IntegrationTestBaseWithIAM.java b/services/sts/src/it/java/software/amazon/awssdk/services/sts/IntegrationTestBaseWithIAM.java index 5be0156e5523..97b3b252be5b 100644 --- a/services/sts/src/it/java/software/amazon/awssdk/services/sts/IntegrationTestBaseWithIAM.java +++ b/services/sts/src/it/java/software/amazon/awssdk/services/sts/IntegrationTestBaseWithIAM.java @@ -17,7 +17,7 @@ import java.io.FileNotFoundException; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.iam.IamClient; @@ -29,7 +29,7 @@ public abstract class IntegrationTestBaseWithIAM extends IntegrationTestBase { /** The shared IAM client for all tests to use. */ protected static IamClient iam; - @BeforeClass + @BeforeAll public static void setUp() throws FileNotFoundException, IOException { IntegrationTestBase.setUp(); iam = IamClient.builder() diff --git a/services/sts/src/it/java/software/amazon/awssdk/services/sts/SecurityTokenServiceIntegrationTest.java b/services/sts/src/it/java/software/amazon/awssdk/services/sts/SecurityTokenServiceIntegrationTest.java index 7e237a424793..aec2964a7f76 100644 --- a/services/sts/src/it/java/software/amazon/awssdk/services/sts/SecurityTokenServiceIntegrationTest.java +++ b/services/sts/src/it/java/software/amazon/awssdk/services/sts/SecurityTokenServiceIntegrationTest.java @@ -18,9 +18,8 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsSessionCredentials; -import software.amazon.awssdk.core.SdkGlobalTime; import software.amazon.awssdk.services.sts.model.GetFederationTokenRequest; import software.amazon.awssdk.services.sts.model.GetFederationTokenResponse; import software.amazon.awssdk.services.sts.model.GetSessionTokenRequest; diff --git a/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/AssumeRoleProfileTest.java b/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/AssumeRoleProfileTest.java index c78978163be8..0c1f77dd3466 100644 --- a/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/AssumeRoleProfileTest.java +++ b/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/AssumeRoleProfileTest.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.auth.credentials.internal.ProfileCredentialsUtils; import software.amazon.awssdk.utils.StringInputStream; import software.amazon.awssdk.profiles.ProfileFile; diff --git a/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/StsWebIdentityCredentialsProviderFactoryTest.java b/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/StsWebIdentityCredentialsProviderFactoryTest.java index f55ad2f6b2f3..d2e2ef05d283 100644 --- a/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/StsWebIdentityCredentialsProviderFactoryTest.java +++ b/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/StsWebIdentityCredentialsProviderFactoryTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.services.sts.internal; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.WebIdentityTokenCredentialsProviderFactory; import software.amazon.awssdk.auth.credentials.internal.WebIdentityCredentialsUtils; diff --git a/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/WebIdentityTokenCredentialProviderTest.java b/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/WebIdentityTokenCredentialProviderTest.java index b3b0a1541674..e20d27cdc01c 100644 --- a/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/WebIdentityTokenCredentialProviderTest.java +++ b/services/sts/src/test/java/software/amazon/awssdk/services/sts/internal/WebIdentityTokenCredentialProviderTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.nio.file.Paths; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.internal.ProfileCredentialsUtils; import software.amazon.awssdk.profiles.ProfileFile; import software.amazon.awssdk.utils.SdkAutoCloseable; diff --git a/services/transcribestreaming/src/it/java/software/amazon/awssdk/services/transcribestreaming/TranscribeStreamingIntegrationTest.java b/services/transcribestreaming/src/it/java/software/amazon/awssdk/services/transcribestreaming/TranscribeStreamingIntegrationTest.java index 54fb9a67d4af..13869ea4c6d0 100644 --- a/services/transcribestreaming/src/it/java/software/amazon/awssdk/services/transcribestreaming/TranscribeStreamingIntegrationTest.java +++ b/services/transcribestreaming/src/it/java/software/amazon/awssdk/services/transcribestreaming/TranscribeStreamingIntegrationTest.java @@ -28,8 +28,8 @@ import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.reactivestreams.Publisher; import org.reactivestreams.Subscriber; @@ -65,7 +65,7 @@ public class TranscribeStreamingIntegrationTest { private static MetricPublisher mockPublisher; - @BeforeClass + @BeforeAll public static void setup() { mockPublisher = mock(MetricPublisher.class); client = TranscribeStreamingAsyncClient.builder() diff --git a/services/waf/src/it/java/software/amazon/awssdk/services/waf/WafIntegrationTest.java b/services/waf/src/it/java/software/amazon/awssdk/services/waf/WafIntegrationTest.java index fcf279ecfc9b..4836077ab693 100644 --- a/services/waf/src/it/java/software/amazon/awssdk/services/waf/WafIntegrationTest.java +++ b/services/waf/src/it/java/software/amazon/awssdk/services/waf/WafIntegrationTest.java @@ -18,10 +18,10 @@ import java.io.IOException; import java.time.Duration; import java.util.List; -import org.junit.AfterClass; +import org.junit.jupiter.api.AfterAll; import org.junit.Assert; -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.retry.backoff.FixedDelayBackoffStrategy; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.waf.model.ChangeAction; @@ -49,7 +49,7 @@ public class WafIntegrationTest extends AwsTestBase { private static WafClient client = null; private static String ipSetId = null; - @BeforeClass + @BeforeAll public static void setup() throws IOException { FixedDelayBackoffStrategy fixedBackoffStrategy = FixedDelayBackoffStrategy.create(Duration.ofSeconds(30)); setUpCredentials(); @@ -60,7 +60,7 @@ public static void setup() throws IOException { .build(); } - @AfterClass + @AfterAll public static void tearDown() throws IOException { if (client != null) { diff --git a/services/workspaces/src/it/java/software/amazon/awssdk/services/workspaces/IntegrationTestBase.java b/services/workspaces/src/it/java/software/amazon/awssdk/services/workspaces/IntegrationTestBase.java index 2324bf261689..f62661705b2f 100644 --- a/services/workspaces/src/it/java/software/amazon/awssdk/services/workspaces/IntegrationTestBase.java +++ b/services/workspaces/src/it/java/software/amazon/awssdk/services/workspaces/IntegrationTestBase.java @@ -16,14 +16,14 @@ package software.amazon.awssdk.services.workspaces; import java.io.IOException; -import org.junit.BeforeClass; +import org.junit.jupiter.api.BeforeAll; import software.amazon.awssdk.testutils.service.AwsTestBase; public class IntegrationTestBase extends AwsTestBase { protected static WorkSpacesClient client; - @BeforeClass + @BeforeAll public static void setup() throws IOException { setUpCredentials(); client = WorkSpacesClient.builder().credentialsProvider(CREDENTIALS_PROVIDER_CHAIN).build(); diff --git a/services/workspaces/src/it/java/software/amazon/awssdk/services/workspaces/ServiceIntegrationTest.java b/services/workspaces/src/it/java/software/amazon/awssdk/services/workspaces/ServiceIntegrationTest.java index 6a7499289427..ecfb48994c94 100644 --- a/services/workspaces/src/it/java/software/amazon/awssdk/services/workspaces/ServiceIntegrationTest.java +++ b/services/workspaces/src/it/java/software/amazon/awssdk/services/workspaces/ServiceIntegrationTest.java @@ -17,7 +17,7 @@ import static org.junit.Assert.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.workspaces.model.CreateWorkspacesRequest; import software.amazon.awssdk.services.workspaces.model.CreateWorkspacesResponse; import software.amazon.awssdk.services.workspaces.model.DescribeWorkspaceBundlesRequest; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointDiscoveryRequestOverrideConfigTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointDiscoveryRequestOverrideConfigTest.java index d67fe633ac2f..3a3b17b4a013 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointDiscoveryRequestOverrideConfigTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointDiscoveryRequestOverrideConfigTest.java @@ -19,9 +19,9 @@ import java.util.List; import java.util.concurrent.TimeUnit; -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 software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; @@ -48,7 +48,7 @@ public class EndpointDiscoveryRequestOverrideConfigTest { private static final AwsBasicCredentials CLIENT_CREDENTIALS = AwsBasicCredentials.create("ca", "cs"); private static final AwsBasicCredentials REQUEST_CREDENTIALS = AwsBasicCredentials.create("ra", "rs"); - @Before + @BeforeEach public void setupClient() { httpClient = new MockSyncHttpClient(); asyncHttpClient = new MockAsyncHttpClient(); @@ -68,7 +68,7 @@ public void setupClient() { .build(); } - @After + @AfterEach public void cleanup() { httpClient.reset(); asyncHttpClient.reset(); diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointDiscoveryTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointDiscoveryTest.java index 3a78b0e356a9..164eb7d7068b 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointDiscoveryTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointDiscoveryTest.java @@ -27,9 +27,9 @@ import java.net.URI; import java.util.concurrent.ExecutionException; import org.assertj.core.api.AbstractThrowableAssert; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryFailedException; @@ -49,7 +49,7 @@ public class EndpointDiscoveryTest { private EndpointDiscoveryTestAsyncClient asyncClient; - @Before + @BeforeEach public void setupClient() { client = EndpointDiscoveryTestClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointVariantResolutionTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointVariantResolutionTest.java index 38fd76c1bafd..ef7e3016d155 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointVariantResolutionTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/EndpointVariantResolutionTest.java @@ -17,22 +17,12 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.assertj.core.api.Assertions.in; -import java.util.Arrays; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider; -import software.amazon.awssdk.core.SdkSystemSetting; -import software.amazon.awssdk.profiles.ProfileFile; -import software.amazon.awssdk.profiles.ProfileProperty; import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.protocolrestjson.ProtocolRestJsonClient; import software.amazon.awssdk.services.protocolrestjson.ProtocolRestJsonClientBuilder; -import software.amazon.awssdk.testutils.EnvironmentVariableHelper; -import software.amazon.awssdk.utils.StringInputStream; -import software.amazon.awssdk.utils.Validate; public class EndpointVariantResolutionTest { @Test diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ExecutionAttributesTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ExecutionAttributesTest.java index 61165b7f69bf..b80d297251c4 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ExecutionAttributesTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ExecutionAttributesTest.java @@ -6,7 +6,7 @@ import static org.mockito.Mockito.mock; import java.util.concurrent.CompletionException; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; import org.mockito.ArgumentCaptor; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/HostPrefixTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/HostPrefixTest.java index 0a12dc428fb3..e34df574dccb 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/HostPrefixTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/HostPrefixTest.java @@ -20,8 +20,8 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.net.URI; -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.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.http.AbortableInputStream; @@ -43,7 +43,7 @@ public class HostPrefixTest { private ProtocolRestJsonAsyncClient asyncClient; - @Before + @BeforeEach public void setupClient() { mockHttpClient = new MockSyncHttpClient(); mockAsyncClient = new MockAsyncHttpClient(); diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/InvalidRegionTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/InvalidRegionTest.java index 623f7cbc0386..b819f5ff240a 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/InvalidRegionTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/InvalidRegionTest.java @@ -17,7 +17,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider; import software.amazon.awssdk.core.exception.SdkClientException; import software.amazon.awssdk.regions.Region; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ModelSerializationTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ModelSerializationTest.java index 5b1b90c415d1..e3c193fe7d94 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ModelSerializationTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ModelSerializationTest.java @@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import java.io.IOException; import java.time.Instant; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.services.protocolrestjson.model.AllTypesRequest; import software.amazon.awssdk.services.protocolrestjson.model.BaseType; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ProfileFileConfigurationTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ProfileFileConfigurationTest.java index a70bb0f2a40f..91985092e83f 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ProfileFileConfigurationTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/ProfileFileConfigurationTest.java @@ -19,7 +19,7 @@ import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import software.amazon.awssdk.auth.credentials.AwsCredentials; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/customizeduseragent/InternalUserAgentTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/customizeduseragent/InternalUserAgentTest.java index 5e6ecce8205b..29b3557fb225 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/customizeduseragent/InternalUserAgentTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/customizeduseragent/InternalUserAgentTest.java @@ -26,9 +26,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; @@ -49,7 +49,7 @@ public class InternalUserAgentTest { private ProtocolRestJsonClient clientWithoutInternalConfig; private ProtocolRestJsonAsyncClient asyncClientWithoutInternalConfig; - @Before + @BeforeEach public void setupClient() { client = ProtocolRestJsonWithInternalConfigClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/customresponsemetadata/CustomResponseMetadataTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/customresponsemetadata/CustomResponseMetadataTest.java index e0104a254ff3..034d0120daa8 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/customresponsemetadata/CustomResponseMetadataTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/customresponsemetadata/CustomResponseMetadataTest.java @@ -24,9 +24,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; import java.util.concurrent.CompletableFuture; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.ResponseBytes; @@ -49,7 +49,7 @@ public class CustomResponseMetadataTest { private ProtocolRestJsonAsyncClient asyncClient; - @Before + @BeforeEach public void setupClient() { client = ProtocolRestJsonClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/documenttype/DocumentTypeTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/documenttype/DocumentTypeTest.java index b2e4a65125fe..e221e597db54 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/documenttype/DocumentTypeTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/documenttype/DocumentTypeTest.java @@ -12,9 +12,9 @@ import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider; @@ -56,7 +56,7 @@ public class DocumentTypeTest { private SdkHttpClient httpClient; - @Before + @BeforeEach public void setup() throws IOException { httpClient = Mockito.mock(SdkHttpClient.class); jsonClient = initializeSync(DocumentTypeJsonClient.builder()).build(); diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/HashCodeEqualsTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/HashCodeEqualsTest.java index 46da01f4cb14..5152cb266433 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/HashCodeEqualsTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/HashCodeEqualsTest.java @@ -21,8 +21,8 @@ import java.time.Duration; import java.util.HashMap; 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.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.awscore.AwsResponseMetadata; import software.amazon.awssdk.awscore.DefaultAwsResponseMetadata; @@ -36,7 +36,7 @@ public class HashCodeEqualsTest { private static AllTypesRequest.Builder requestBuilder; private static AllTypesResponse.Builder responseBuilder; - @BeforeClass + @BeforeAll public static void setUp() { requestBuilder = AllTypesRequest.builder() diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/GetValueForFieldTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/GetValueForFieldTest.java index 33275739d2e2..418a74d650f2 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/GetValueForFieldTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/GetValueForFieldTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Tests for the generated {@code getValueForField} methods on model objects. diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ListCopierTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ListCopierTest.java index feaf6793d43f..e8ca98010c78 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ListCopierTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ListCopierTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.ArrayList; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList; import software.amazon.awssdk.core.util.SdkAutoConstructList; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/MapCopierTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/MapCopierTest.java index 98102618dad9..e6e999ebb5a0 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/MapCopierTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/MapCopierTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.services.protocolrestjson.model; import org.assertj.core.api.Assertions; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap; import software.amazon.awssdk.core.util.SdkAutoConstructMap; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ModelBuilderListMemberTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ModelBuilderListMemberTest.java index 64281a760651..e1469ee93b1a 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ModelBuilderListMemberTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ModelBuilderListMemberTest.java @@ -19,7 +19,7 @@ import java.util.ArrayList; import java.util.Collection; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.util.SdkAutoConstructList; /** diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ModelBuilderMapMemberTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ModelBuilderMapMemberTest.java index 7a91e323e39c..3d747628bd46 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ModelBuilderMapMemberTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/protocolrestjson/model/ModelBuilderMapMemberTest.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.services.protocolrestjson.model; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.util.SdkAutoConstructMap; import java.util.HashMap; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/retry/ClientRetryModeTestSuite.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/retry/ClientRetryModeTestSuite.java index 35d5d70e23f8..6934c8fa06f0 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/retry/ClientRetryModeTestSuite.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/retry/ClientRetryModeTestSuite.java @@ -19,7 +19,6 @@ import static com.github.tomakehurst.wiremock.client.WireMock.anyRequestedFor; import static com.github.tomakehurst.wiremock.client.WireMock.anyUrl; import static com.github.tomakehurst.wiremock.client.WireMock.post; -import static com.github.tomakehurst.wiremock.client.WireMock.proxyAllTo; import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; import static com.github.tomakehurst.wiremock.client.WireMock.verify; import static org.assertj.core.api.Assertions.assertThat; @@ -31,7 +30,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/retry/RetryHeaderTestSuite.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/retry/RetryHeaderTestSuite.java index 9b683170a5c0..2644227b9e1a 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/retry/RetryHeaderTestSuite.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/retry/RetryHeaderTestSuite.java @@ -19,8 +19,8 @@ import java.util.List; import java.util.stream.Stream; -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.HttpExecuteResponse; import software.amazon.awssdk.http.SdkHttpRequest; import software.amazon.awssdk.http.SdkHttpResponse; @@ -36,7 +36,7 @@ protected RetryHeaderTestSuite(T mockHttpClient) { this.mockHttpClient = mockHttpClient; } - @Before + @BeforeEach public void setupClient() { mockHttpClient.reset(); } diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/tostring/SensitiveDataRedactedTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/tostring/SensitiveDataRedactedTest.java index 48b4fc5deba0..7430679f6da0 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/tostring/SensitiveDataRedactedTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/tostring/SensitiveDataRedactedTest.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.tostring.model.InputShape; public class SensitiveDataRedactedTest { diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersAsyncFunctionalTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersAsyncFunctionalTest.java index 847a565c240a..64a78cfcdcab 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersAsyncFunctionalTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersAsyncFunctionalTest.java @@ -26,9 +26,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.ScheduledExecutorService; -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 software.amazon.awssdk.awscore.exception.AwsErrorDetails; import software.amazon.awssdk.core.exception.SdkClientException; import software.amazon.awssdk.core.exception.SdkServiceException; @@ -36,7 +36,6 @@ import software.amazon.awssdk.core.waiters.WaiterOverrideConfiguration; import software.amazon.awssdk.core.waiters.WaiterResponse; import software.amazon.awssdk.http.SdkHttpResponse; -import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.restjsonwithwaiters.RestJsonWithWaitersAsyncClient; import software.amazon.awssdk.services.restjsonwithwaiters.model.AllTypesRequest; import software.amazon.awssdk.services.restjsonwithwaiters.model.AllTypesResponse; @@ -50,7 +49,7 @@ public class WaitersAsyncFunctionalTest { public RestJsonWithWaitersAsyncClient asyncClient; public RestJsonWithWaitersAsyncWaiter asyncWaiter; - @Before + @BeforeEach public void setup() { asyncClient = mock(RestJsonWithWaitersAsyncClient.class); asyncWaiter = RestJsonWithWaitersAsyncWaiter.builder() @@ -62,7 +61,7 @@ public void setup() { .build(); } - @After + @AfterEach public void cleanup() { asyncClient.close(); asyncWaiter.close(); diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeDefaultAcceptorsTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeDefaultAcceptorsTest.java index 36b43a64db09..dd5fc7709bed 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeDefaultAcceptorsTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeDefaultAcceptorsTest.java @@ -18,8 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import org.junit.Test; -import software.amazon.awssdk.core.exception.SdkException; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.waiters.WaiterState; import software.amazon.awssdk.services.restjsonwithwaiters.waiters.internal.WaitersRuntime; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeResponseStatusAcceptorTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeResponseStatusAcceptorTest.java index 977104a719b7..b4595533030b 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeResponseStatusAcceptorTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeResponseStatusAcceptorTest.java @@ -18,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkField; import software.amazon.awssdk.core.SdkResponse; import software.amazon.awssdk.core.exception.SdkException; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeValueTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeValueTest.java index 47837f343e1f..7f3845b9e8ef 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeValueTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersRuntimeValueTest.java @@ -26,7 +26,7 @@ import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkField; import software.amazon.awssdk.core.SdkPojo; import software.amazon.awssdk.core.protocol.MarshallingType; diff --git a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersSyncFunctionalTest.java b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersSyncFunctionalTest.java index 3da0198d74f7..695c4489837f 100644 --- a/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersSyncFunctionalTest.java +++ b/test/codegen-generated-classes-test/src/test/java/software/amazon/awssdk/services/waiters/WaitersSyncFunctionalTest.java @@ -23,9 +23,9 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -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 software.amazon.awssdk.awscore.exception.AwsErrorDetails; import software.amazon.awssdk.core.exception.SdkClientException; import software.amazon.awssdk.core.exception.SdkServiceException; @@ -45,7 +45,7 @@ public class WaitersSyncFunctionalTest { private RestJsonWithWaitersClient client; private RestJsonWithWaitersWaiter waiter; - @Before + @BeforeEach public void setup() { client = mock(RestJsonWithWaitersClient.class); waiter = RestJsonWithWaitersWaiter.builder() @@ -57,7 +57,7 @@ public void setup() { .build(); } - @After + @AfterEach public void cleanup() { client.close(); waiter.close(); diff --git a/test/http-client-tests/src/main/java/software/amazon/awssdk/http/SdkAsyncHttpClientH1TestSuite.java b/test/http-client-tests/src/main/java/software/amazon/awssdk/http/SdkAsyncHttpClientH1TestSuite.java index f4b12634d3e6..64fec596dc53 100644 --- a/test/http-client-tests/src/main/java/software/amazon/awssdk/http/SdkAsyncHttpClientH1TestSuite.java +++ b/test/http-client-tests/src/main/java/software/amazon/awssdk/http/SdkAsyncHttpClientH1TestSuite.java @@ -48,9 +48,9 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -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 software.amazon.awssdk.http.async.SdkAsyncHttpClient; /** @@ -65,7 +65,7 @@ public abstract class SdkAsyncHttpClientH1TestSuite { protected abstract SdkAsyncHttpClient setupClient(); - @Before + @BeforeEach public void setup() throws Exception { server = new Server(); server.init(); @@ -73,7 +73,7 @@ public void setup() throws Exception { this.client = setupClient(); } - @After + @AfterEach public void teardown() throws InterruptedException { if (server != null) { server.shutdown(); diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncFaultTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncFaultTest.java index b76bfd1bb0cb..f1c14e7dee61 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncFaultTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncFaultTest.java @@ -25,9 +25,9 @@ import java.net.URI; import java.nio.ByteBuffer; import java.util.concurrent.CompletableFuture; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; @@ -47,7 +47,7 @@ public class AsyncFaultTest { private ProtocolRestJsonAsyncClient client; - @Before + @BeforeEach public void setup() { client = ProtocolRestJsonAsyncClient.builder() .region(Region.US_WEST_1) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncResponseThreadingTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncResponseThreadingTest.java index da9c40cee1b7..0aa9da524c3c 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncResponseThreadingTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncResponseThreadingTest.java @@ -29,7 +29,7 @@ import java.net.URI; import java.util.concurrent.Executor; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.core.ResponseBytes; diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncResponseTransformerTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncResponseTransformerTest.java index 4d0846216cc9..1cd43ed55e62 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncResponseTransformerTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/AsyncResponseTransformerTest.java @@ -23,15 +23,14 @@ import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; import static org.mockito.Matchers.any; -import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; import java.util.concurrent.CompletableFuture; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.AwsCredentialsProviderChain; import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider; @@ -56,7 +55,7 @@ public class AsyncResponseTransformerTest { private ProtocolRestJsonAsyncClient jsonClient; private ProtocolQueryAsyncClient xmlClient; - @Before + @BeforeEach public void setupClient() { jsonClient = ProtocolRestJsonAsyncClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/Ec2ProtocolTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/Ec2ProtocolTest.java index 86da7910d88f..3a779fe59b72 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/Ec2ProtocolTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/Ec2ProtocolTest.java @@ -15,8 +15,8 @@ package software.amazon.awssdk.protocol.tests; -import org.junit.BeforeClass; -import org.junit.Test; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.protocol.ProtocolTestSuiteLoader; import software.amazon.awssdk.protocol.runners.ProtocolTestRunner; @@ -25,7 +25,7 @@ public class Ec2ProtocolTest extends ProtocolTestBase { private static final ProtocolTestSuiteLoader testSuiteLoader = new ProtocolTestSuiteLoader(); private static ProtocolTestRunner testRunner; - @BeforeClass + @BeforeAll public static void setupFixture() { testRunner = new ProtocolTestRunner("/models/ec2-2016-03-11-intermediate.json"); } diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/EnumTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/EnumTest.java index f71809b652ba..6ea358cbbac8 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/EnumTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/EnumTest.java @@ -23,7 +23,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.stream.Stream; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.protocolrestjson.model.AllTypesResponse; import software.amazon.awssdk.services.protocolrestjson.model.EnumType; diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/EventTransformTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/EventTransformTest.java index 04a30f3b538b..cc7bc36ff4e2 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/EventTransformTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/EventTransformTest.java @@ -18,8 +18,8 @@ import static org.assertj.core.api.Assertions.assertThat; import java.net.URI; -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.SdkBytes; import software.amazon.awssdk.core.SdkPojo; import software.amazon.awssdk.core.client.config.SdkClientConfiguration; @@ -44,7 +44,7 @@ public class EventTransformTest { private static final String HEADER_MEMBER = "foo"; private static AwsJsonProtocolFactory protocolFactory; - @BeforeClass + @BeforeAll public static void setup() { protocolFactory = AwsJsonProtocolFactory.builder() .clientConfiguration( diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ExecutionInterceptorTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ExecutionInterceptorTest.java index 7d6a69323dd4..aab6a5b2c29c 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ExecutionInterceptorTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ExecutionInterceptorTest.java @@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.InOrder; import org.mockito.Mockito; diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ImmutableModelTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ImmutableModelTest.java index 430f57f8bc02..a831df142c19 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ImmutableModelTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ImmutableModelTest.java @@ -25,7 +25,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.SdkBytes; import software.amazon.awssdk.services.protocolrestjson.model.AllTypesRequest; import software.amazon.awssdk.services.protocolrestjson.model.SimpleStruct; diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/QueryMetadataTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/QueryMetadataTest.java index 1fe3cc39e3bb..df0ceab94cdb 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/QueryMetadataTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/QueryMetadataTest.java @@ -23,9 +23,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; @@ -46,7 +46,7 @@ public class QueryMetadataTest extends ProtocolTestBase { private ProtocolQueryAsyncClient asyncClient; - @Before + @BeforeEach public void setupClient() { client = ProtocolQueryClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/QueryRequestTransformTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/QueryRequestTransformTest.java index c9187907a3d8..3439277a340a 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/QueryRequestTransformTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/QueryRequestTransformTest.java @@ -19,7 +19,6 @@ import static com.github.tomakehurst.wiremock.client.WireMock.anyUrl; import static com.github.tomakehurst.wiremock.client.WireMock.containing; import static com.github.tomakehurst.wiremock.client.WireMock.equalTo; -import static com.github.tomakehurst.wiremock.client.WireMock.getAllServeEvents; import static com.github.tomakehurst.wiremock.client.WireMock.matching; import static com.github.tomakehurst.wiremock.client.WireMock.post; import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor; @@ -27,10 +26,9 @@ import static com.github.tomakehurst.wiremock.client.WireMock.verify; import com.github.tomakehurst.wiremock.junit.WireMockRule; -import com.github.tomakehurst.wiremock.stubbing.ServeEvent; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.http.Header; @@ -40,7 +38,6 @@ import software.amazon.awssdk.services.protocolquery.model.IdempotentOperationRequest; import java.net.URI; -import java.util.List; public class QueryRequestTransformTest extends ProtocolTestBase { @@ -50,7 +47,7 @@ public class QueryRequestTransformTest extends ProtocolTestBase { private ProtocolQueryClient client; private ProtocolQueryAsyncClient asyncClient; - @Before + @BeforeEach public void setupClient() { client = ProtocolQueryClient.builder() .credentialsProvider(StaticCredentialsProvider.create( diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ResourceManagementTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ResourceManagementTest.java index 72ce1323b8de..7bc21c98f844 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ResourceManagementTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ResourceManagementTest.java @@ -23,7 +23,7 @@ import static software.amazon.awssdk.core.client.config.SdkAdvancedAsyncClientOption.FUTURE_COMPLETION_EXECUTOR; import java.util.concurrent.ExecutorService; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider; import software.amazon.awssdk.http.SdkHttpClient; import software.amazon.awssdk.http.async.SdkAsyncHttpClient; diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ResponseTransformerTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ResponseTransformerTest.java index ffe38a7a54e4..3dbe564340d7 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ResponseTransformerTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/ResponseTransformerTest.java @@ -36,7 +36,7 @@ import java.time.Duration; import java.util.UUID; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.core.ResponseBytes; import software.amazon.awssdk.core.exception.SdkClientException; diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/RestJsonEventStreamProtocolTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/RestJsonEventStreamProtocolTest.java index a7a01da2be30..7e665a8d7cc3 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/RestJsonEventStreamProtocolTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/RestJsonEventStreamProtocolTest.java @@ -19,7 +19,7 @@ import java.net.URI; import java.nio.charset.StandardCharsets; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.SdkBytes; import software.amazon.awssdk.core.client.config.SdkClientConfiguration; import software.amazon.awssdk.core.client.config.SdkClientOption; diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/SdkHttpResponseTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/SdkHttpResponseTest.java index 73d4a16667d8..0577a4e8e56e 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/SdkHttpResponseTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/SdkHttpResponseTest.java @@ -30,9 +30,9 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.awscore.AwsResponse; import software.amazon.awssdk.awscore.AwsResponseMetadata; @@ -70,7 +70,7 @@ public class SdkHttpResponseTest { put("x-amzn-RequestId", Collections.singletonList(REQUEST_ID)); }}; - @Before + @BeforeEach public void setupClient() { client = ProtocolRestJsonClient.builder() .region(Region.US_WEST_1) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/XmlMetadataTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/XmlMetadataTest.java index 9a978fa71879..66a34bc6b848 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/XmlMetadataTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/XmlMetadataTest.java @@ -23,9 +23,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; @@ -46,7 +46,7 @@ public class XmlMetadataTest { private ProtocolRestXmlAsyncClient asyncClient; - @Before + @BeforeEach public void setupClient() { client = ProtocolRestXmlClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/clockskew/ClockSkewAdjustmentTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/clockskew/ClockSkewAdjustmentTest.java index 30858d40d893..e1f5c4c9a109 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/clockskew/ClockSkewAdjustmentTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/clockskew/ClockSkewAdjustmentTest.java @@ -37,9 +37,9 @@ import java.util.List; import java.util.concurrent.CompletionException; import java.util.function.Supplier; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.SdkGlobalTime; @@ -61,7 +61,7 @@ public class ClockSkewAdjustmentTest { private ProtocolJsonRpcClient client; private ProtocolJsonRpcAsyncClient asyncClient; - @Before + @BeforeEach public void setupClient() { SdkGlobalTime.setGlobalTimeOffset(0); client = createClient(1); diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/connection/SyncClientConnectionTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/connection/SyncClientConnectionTest.java index f8a8944738f3..b4a53de17025 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/connection/SyncClientConnectionTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/connection/SyncClientConnectionTest.java @@ -20,8 +20,8 @@ import java.io.IOException; import java.io.InputStream; -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.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.ResponseInputStream; @@ -46,7 +46,7 @@ public class SyncClientConnectionTest { private ProtocolRestJsonClient client; private MockHttpClient mockHttpClient; - @Before + @BeforeEach public void setupClient() { mockHttpClient = new MockHttpClient(); client = ProtocolRestJsonClient.builder() diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/crc32/AwsJsonAsyncCrc32ChecksumTests.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/crc32/AwsJsonAsyncCrc32ChecksumTests.java index 4f46d4cd7265..938b6213c52f 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/crc32/AwsJsonAsyncCrc32ChecksumTests.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/crc32/AwsJsonAsyncCrc32ChecksumTests.java @@ -27,9 +27,9 @@ import java.net.URI; import java.util.concurrent.ExecutionException; import org.junit.Assert; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.exception.Crc32MismatchException; @@ -62,7 +62,7 @@ public class AwsJsonAsyncCrc32ChecksumTests { private ProtocolJsonRpcCustomizedAsyncClient customizedJsonRpcAsync; private ProtocolJsonRpcAsyncClient jsonRpcAsync; - @Before + @BeforeEach public void setup() { jsonRpcAsync = ProtocolJsonRpcAsyncClient.builder() .credentialsProvider(FAKE_CREDENTIALS_PROVIDER) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/customservicemetadata/CustomServiceMetaDataServiceTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/customservicemetadata/CustomServiceMetaDataServiceTest.java index 355ed1ce0f1c..b2de92015320 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/customservicemetadata/CustomServiceMetaDataServiceTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/customservicemetadata/CustomServiceMetaDataServiceTest.java @@ -5,7 +5,7 @@ import com.github.tomakehurst.wiremock.core.WireMockConfiguration; import com.github.tomakehurst.wiremock.junit.WireMockRule; import org.junit.Rule; -import org.junit.Test; + import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; import static com.github.tomakehurst.wiremock.client.WireMock.post; import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; @@ -17,6 +17,7 @@ import java.net.URI; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.services.protocoljsonrpc.ProtocolJsonRpcClient; diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/AwsJsonExceptionTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/AwsJsonExceptionTest.java index 7797845a9168..6e75b311b63c 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/AwsJsonExceptionTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/AwsJsonExceptionTest.java @@ -27,9 +27,9 @@ import java.net.URI; import java.time.Instant; import java.util.AbstractMap.SimpleEntry; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.awscore.exception.AwsErrorDetails; @@ -51,7 +51,7 @@ public class AwsJsonExceptionTest { private ProtocolJsonRpcClient client; - @Before + @BeforeEach public void setupClient() { client = ProtocolJsonRpcClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/Ec2ExceptionTests.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/Ec2ExceptionTests.java index 8ecb5e5d38c6..60cc8702f682 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/Ec2ExceptionTests.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/Ec2ExceptionTests.java @@ -20,9 +20,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.regions.Region; @@ -38,7 +38,7 @@ public class Ec2ExceptionTests { private ProtocolEc2Client client; - @Before + @BeforeEach public void setupClient() { client = ProtocolEc2Client.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/QueryExceptionTests.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/QueryExceptionTests.java index b65247235eda..781e62c1ca1e 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/QueryExceptionTests.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/QueryExceptionTests.java @@ -27,9 +27,9 @@ import java.net.URI; import java.time.Instant; import java.util.AbstractMap.SimpleEntry; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.awscore.exception.AwsErrorDetails; @@ -51,7 +51,7 @@ public class QueryExceptionTests { private ProtocolQueryClient client; - @Before + @BeforeEach public void setupClient() { client = ProtocolQueryClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/RestJsonExceptionTests.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/RestJsonExceptionTests.java index 818bd1c4a8e6..b8f66b33ced6 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/RestJsonExceptionTests.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/RestJsonExceptionTests.java @@ -28,9 +28,9 @@ import java.net.URI; import java.time.Instant; import java.util.AbstractMap.SimpleEntry; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.awscore.exception.AwsErrorDetails; @@ -57,7 +57,7 @@ public class RestJsonExceptionTests { private ProtocolRestJsonClient client; - @Before + @BeforeEach public void setupClient() { client = ProtocolRestJsonClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/RestXmlExceptionTests.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/RestXmlExceptionTests.java index 6630c3a2b773..fe64e9d6e632 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/RestXmlExceptionTests.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/exception/RestXmlExceptionTests.java @@ -27,9 +27,9 @@ import java.net.URI; import java.time.Instant; import java.util.AbstractMap.SimpleEntry; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.awscore.exception.AwsErrorDetails; @@ -51,7 +51,7 @@ public class RestXmlExceptionTests { private ProtocolRestXmlClient client; - @Before + @BeforeEach public void setupClient() { client = ProtocolRestXmlClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/retry/AsyncAwsJsonRetryTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/retry/AsyncAwsJsonRetryTest.java index 53d78e1f15bd..fcd11c8de735 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/retry/AsyncAwsJsonRetryTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/retry/AsyncAwsJsonRetryTest.java @@ -25,9 +25,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import com.github.tomakehurst.wiremock.stubbing.Scenario; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.retry.RetryPolicy; @@ -47,7 +47,7 @@ public class AsyncAwsJsonRetryTest { private ProtocolJsonRpcAsyncClient client; - @Before + @BeforeEach public void setupClient() { client = ProtocolJsonRpcAsyncClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/retry/AwsJsonRetryTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/retry/AwsJsonRetryTest.java index 6ea489b2c3b8..ed029bd9e3da 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/retry/AwsJsonRetryTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/retry/AwsJsonRetryTest.java @@ -25,9 +25,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import com.github.tomakehurst.wiremock.stubbing.Scenario; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.retry.RetryPolicy; @@ -47,7 +47,7 @@ public class AwsJsonRetryTest { private ProtocolJsonRpcClient client; - @Before + @BeforeEach public void setupClient() { client = ProtocolJsonRpcClient.builder() .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create("akid", "skid"))) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/BaseApiCallAttemptTimeoutTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/BaseApiCallAttemptTimeoutTest.java index 9c1bb3921a0a..ca20044b1c37 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/BaseApiCallAttemptTimeoutTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/BaseApiCallAttemptTimeoutTest.java @@ -23,7 +23,7 @@ import static software.amazon.awssdk.protocol.wiremock.WireMockUtils.verifyRequestCount; import com.github.tomakehurst.wiremock.stubbing.Scenario; -import org.junit.Test; +import org.junit.jupiter.api.Test; public abstract class BaseApiCallAttemptTimeoutTest extends BaseTimeoutTest { diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/BaseApiCallTimeoutTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/BaseApiCallTimeoutTest.java index db6fd019d313..3d69f8de51d8 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/BaseApiCallTimeoutTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/BaseApiCallTimeoutTest.java @@ -23,7 +23,7 @@ import static software.amazon.awssdk.protocol.wiremock.WireMockUtils.verifyRequestCount; import com.github.tomakehurst.wiremock.stubbing.Scenario; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Contains common scenarios to test timeout feature. diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncApiCallAttemptsTimeoutTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncApiCallAttemptsTimeoutTest.java index 51dc46619793..f2b519bf2bea 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncApiCallAttemptsTimeoutTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncApiCallAttemptsTimeoutTest.java @@ -30,9 +30,9 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Consumer; import org.assertj.core.api.ThrowableAssert; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.core.ResponseBytes; import software.amazon.awssdk.core.async.AsyncResponseTransformer; @@ -60,7 +60,7 @@ public class AsyncApiCallAttemptsTimeoutTest extends BaseApiCallAttemptTimeoutTe private static final int DELAY_BEFORE_API_CALL_ATTEMPT_TIMEOUT = 100; private static final int DELAY_AFTER_API_CALL_ATTEMPT_TIMEOUT = 1000; - @Before + @BeforeEach public void setup() { client = ProtocolRestJsonAsyncClient.builder() .region(Region.US_WEST_1) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncApiCallTimeoutTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncApiCallTimeoutTest.java index 7ad0319a2c7b..183270be3241 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncApiCallTimeoutTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncApiCallTimeoutTest.java @@ -29,9 +29,9 @@ import java.util.concurrent.CompletableFuture; import java.util.function.Consumer; import org.assertj.core.api.ThrowableAssert; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.core.async.AsyncResponseTransformer; import software.amazon.awssdk.core.exception.ApiCallTimeoutException; @@ -53,7 +53,7 @@ public class AsyncApiCallTimeoutTest extends BaseApiCallTimeoutTest { private ProtocolRestJsonAsyncClient client; private ProtocolRestJsonAsyncClient clientWithRetry; - @Before + @BeforeEach public void setup() { client = ProtocolRestJsonAsyncClient.builder() .region(Region.US_WEST_1) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncTimeoutTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncTimeoutTest.java index 15108cd8892e..81ca8bca9e55 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncTimeoutTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/async/AsyncTimeoutTest.java @@ -26,9 +26,9 @@ import java.net.URI; import java.time.Duration; import java.util.concurrent.CompletableFuture; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.core.exception.ApiCallAttemptTimeoutException; import software.amazon.awssdk.core.retry.RetryPolicy; @@ -51,7 +51,7 @@ public class AsyncTimeoutTest { private static final int DELAY_AFTER_API_CALL_ATTEMPT_TIMEOUT = 1100; private ProtocolRestJsonAsyncClient client; - @Before + @BeforeEach public void setup() { client = ProtocolRestJsonAsyncClient.builder() .region(Region.US_WEST_1) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/BaseSyncStreamingTimeoutTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/BaseSyncStreamingTimeoutTest.java index 9c710900217b..3aac5318e368 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/BaseSyncStreamingTimeoutTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/BaseSyncStreamingTimeoutTest.java @@ -24,9 +24,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; import software.amazon.awssdk.protocol.tests.timeout.BaseTimeoutTest; @@ -43,7 +43,7 @@ public abstract class BaseSyncStreamingTimeoutTest { protected static final int TIMEOUT = 1000; protected static final int DELAY_BEFORE_TIMEOUT = 100; - @Before + @BeforeEach public void setup() { client = ProtocolRestJsonClient.builder() .region(Region.US_WEST_1) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncApiCallAttemptTimeoutTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncApiCallAttemptTimeoutTest.java index 2e2872339302..4935e038befd 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncApiCallAttemptTimeoutTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncApiCallAttemptTimeoutTest.java @@ -23,7 +23,7 @@ import java.util.concurrent.Callable; import java.util.function.Consumer; import org.assertj.core.api.ThrowableAssert; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.core.exception.ApiCallAttemptTimeoutException; @@ -47,7 +47,7 @@ public class SyncApiCallAttemptTimeoutTest extends BaseApiCallAttemptTimeoutTest private ProtocolRestJsonClient clientWithRetry; private static final int API_CALL_ATTEMPT_TIMEOUT = 800; - @Before + @BeforeEach public void setup() { client = ProtocolRestJsonClient.builder() .region(Region.US_WEST_1) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncApiCallTimeoutTest.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncApiCallTimeoutTest.java index c1e6c8168baa..b9248c5ff7b8 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncApiCallTimeoutTest.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncApiCallTimeoutTest.java @@ -28,9 +28,9 @@ import java.util.concurrent.Callable; import java.util.function.Consumer; import org.assertj.core.api.ThrowableAssert; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.core.exception.ApiCallTimeoutException; import software.amazon.awssdk.core.retry.RetryPolicy; @@ -53,7 +53,7 @@ public class SyncApiCallTimeoutTest extends BaseApiCallTimeoutTest { private ProtocolRestJsonClient client; private ProtocolRestJsonClient clientWithRetry; - @Before + @BeforeEach public void setup() { client = ProtocolRestJsonClient.builder() .region(Region.US_WEST_1) diff --git a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncTimeoutTests.java b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncTimeoutTests.java index 43d4cd3c3aea..6c1ae3370772 100644 --- a/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncTimeoutTests.java +++ b/test/protocol-tests/src/test/java/software/amazon/awssdk/protocol/tests/timeout/sync/SyncTimeoutTests.java @@ -25,9 +25,9 @@ import com.github.tomakehurst.wiremock.junit.WireMockRule; import java.net.URI; import java.time.Duration; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.core.exception.ApiCallAttemptTimeoutException; import software.amazon.awssdk.core.exception.ApiCallTimeoutException; @@ -51,7 +51,7 @@ public class SyncTimeoutTests { private static final int DELAY_AFTER_API_CALL_ATTEMPT_TIMEOUT = 1100; private ProtocolRestJsonClient client; - @Before + @BeforeEach public void setup() { client = ProtocolRestJsonClient.builder() .region(Region.US_WEST_1) diff --git a/test/test-utils/src/main/java/software/amazon/awssdk/testutils/LogCaptor.java b/test/test-utils/src/main/java/software/amazon/awssdk/testutils/LogCaptor.java index b0f8da0163c3..b035cf33c384 100644 --- a/test/test-utils/src/main/java/software/amazon/awssdk/testutils/LogCaptor.java +++ b/test/test-utils/src/main/java/software/amazon/awssdk/testutils/LogCaptor.java @@ -21,8 +21,8 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.spi.LoggingEvent; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import software.amazon.awssdk.utils.SdkAutoCloseable; /** @@ -62,13 +62,13 @@ public LogCaptorTestBase() { } @Override - @Before + @BeforeEach public void setupLogging() { super.setupLogging(); } @Override - @After + @AfterEach public void stopLogging() { super.stopLogging(); } diff --git a/test/test-utils/src/test/java/software/amazon/awssdk/core/auth/policy/PolicyReaderTest.java b/test/test-utils/src/test/java/software/amazon/awssdk/core/auth/policy/PolicyReaderTest.java index 85ff8e5882c0..10353f601b09 100644 --- a/test/test-utils/src/test/java/software/amazon/awssdk/core/auth/policy/PolicyReaderTest.java +++ b/test/test-utils/src/test/java/software/amazon/awssdk/core/auth/policy/PolicyReaderTest.java @@ -21,7 +21,7 @@ import java.util.LinkedList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.auth.policy.Principal.Service; import software.amazon.awssdk.core.auth.policy.Statement.Effect; import software.amazon.awssdk.core.auth.policy.conditions.ConditionFactory; diff --git a/test/test-utils/src/test/java/software/amazon/awssdk/core/auth/policy/PolicyTest.java b/test/test-utils/src/test/java/software/amazon/awssdk/core/auth/policy/PolicyTest.java index ebf90ab6e0f6..9fc7c6730385 100644 --- a/test/test-utils/src/test/java/software/amazon/awssdk/core/auth/policy/PolicyTest.java +++ b/test/test-utils/src/test/java/software/amazon/awssdk/core/auth/policy/PolicyTest.java @@ -24,7 +24,7 @@ import java.util.HashSet; import java.util.Set; import junit.framework.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.core.auth.policy.Principal.Service; import software.amazon.awssdk.core.auth.policy.Principal.WebIdentityProvider; import software.amazon.awssdk.core.auth.policy.Statement.Effect; diff --git a/test/test-utils/src/test/java/software/amazon/awssdk/testutils/DateUtilsTest.java b/test/test-utils/src/test/java/software/amazon/awssdk/testutils/DateUtilsTest.java index 785e2f05292c..728514c58dcc 100644 --- a/test/test-utils/src/test/java/software/amazon/awssdk/testutils/DateUtilsTest.java +++ b/test/test-utils/src/test/java/software/amazon/awssdk/testutils/DateUtilsTest.java @@ -17,7 +17,7 @@ import static org.junit.Assert.assertTrue; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class DateUtilsTest { @Test diff --git a/test/test-utils/src/test/java/software/amazon/awssdk/testutils/MemoryTest.java b/test/test-utils/src/test/java/software/amazon/awssdk/testutils/MemoryTest.java index f2de039256c6..e271a1eb3bf0 100644 --- a/test/test-utils/src/test/java/software/amazon/awssdk/testutils/MemoryTest.java +++ b/test/test-utils/src/test/java/software/amazon/awssdk/testutils/MemoryTest.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.testutils; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class MemoryTest { diff --git a/test/test-utils/src/test/java/software/amazon/awssdk/testutils/UnorderedCollectionComparatorTest.java b/test/test-utils/src/test/java/software/amazon/awssdk/testutils/UnorderedCollectionComparatorTest.java index b0c73783a769..36aa5c8684c2 100644 --- a/test/test-utils/src/test/java/software/amazon/awssdk/testutils/UnorderedCollectionComparatorTest.java +++ b/test/test-utils/src/test/java/software/amazon/awssdk/testutils/UnorderedCollectionComparatorTest.java @@ -20,7 +20,7 @@ import java.util.Arrays; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class UnorderedCollectionComparatorTest { diff --git a/test/test-utils/src/test/java/software/amazon/awssdk/testutils/smoketest/ReflectionUtilsTest.java b/test/test-utils/src/test/java/software/amazon/awssdk/testutils/smoketest/ReflectionUtilsTest.java index 51696359e240..3727e9dace0d 100644 --- a/test/test-utils/src/test/java/software/amazon/awssdk/testutils/smoketest/ReflectionUtilsTest.java +++ b/test/test-utils/src/test/java/software/amazon/awssdk/testutils/smoketest/ReflectionUtilsTest.java @@ -21,7 +21,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.mockito.Mockito.mock; -import org.junit.Test; +import org.junit.jupiter.api.Test; @SuppressWarnings("unused") public class ReflectionUtilsTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/Base16CodecTest.java b/utils/src/test/java/software/amazon/awssdk/utils/Base16CodecTest.java index 04d9d55b8d78..9e741a7f9380 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/Base16CodecTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/Base16CodecTest.java @@ -21,7 +21,7 @@ import java.util.Arrays; import java.util.UUID; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.utils.internal.Base16; import software.amazon.awssdk.utils.internal.Base16Lower; diff --git a/utils/src/test/java/software/amazon/awssdk/utils/Base16LowerCodecTest.java b/utils/src/test/java/software/amazon/awssdk/utils/Base16LowerCodecTest.java index 3c0ade83597e..a799cf945778 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/Base16LowerCodecTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/Base16LowerCodecTest.java @@ -21,7 +21,7 @@ import java.util.Arrays; import java.util.UUID; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.utils.internal.Base16; import software.amazon.awssdk.utils.internal.Base16Lower; diff --git a/utils/src/test/java/software/amazon/awssdk/utils/Base64UtilsCodecTest.java b/utils/src/test/java/software/amazon/awssdk/utils/Base64UtilsCodecTest.java index f15bec124719..c3fd2c4bdfad 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/Base64UtilsCodecTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/Base64UtilsCodecTest.java @@ -21,7 +21,7 @@ import java.util.Arrays; import java.util.UUID; import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class Base64UtilsCodecTest { @Test diff --git a/utils/src/test/java/software/amazon/awssdk/utils/BinaryUtilsTest.java b/utils/src/test/java/software/amazon/awssdk/utils/BinaryUtilsTest.java index fcacdf221ef5..b484b27e2325 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/BinaryUtilsTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/BinaryUtilsTest.java @@ -23,7 +23,7 @@ import java.nio.ByteBuffer; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.utils.internal.Base16Lower; public class BinaryUtilsTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/CollectionUtilsTest.java b/utils/src/test/java/software/amazon/awssdk/utils/CollectionUtilsTest.java index 29d73efdda85..9a9a861e46c0 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/CollectionUtilsTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/CollectionUtilsTest.java @@ -33,7 +33,7 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class CollectionUtilsTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/ComparableUtilsTest.java b/utils/src/test/java/software/amazon/awssdk/utils/ComparableUtilsTest.java index bfc5fa003e68..eb757c4e7ea2 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/ComparableUtilsTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/ComparableUtilsTest.java @@ -20,7 +20,7 @@ import static org.hamcrest.Matchers.lessThan; import static org.junit.Assert.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ComparableUtilsTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/FunctionalUtilsTest.java b/utils/src/test/java/software/amazon/awssdk/utils/FunctionalUtilsTest.java index bc93d70034ad..3be9ded07854 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/FunctionalUtilsTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/FunctionalUtilsTest.java @@ -25,7 +25,7 @@ import java.io.UncheckedIOException; import java.util.Optional; import java.util.stream.Stream; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class FunctionalUtilsTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/HostnameValidatorTest.java b/utils/src/test/java/software/amazon/awssdk/utils/HostnameValidatorTest.java index 4a5361eaf769..641868607cfd 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/HostnameValidatorTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/HostnameValidatorTest.java @@ -15,7 +15,7 @@ package software.amazon.awssdk.utils; import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.junit.rules.ExpectedException; public class HostnameValidatorTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/ImmutableMapTest.java b/utils/src/test/java/software/amazon/awssdk/utils/ImmutableMapTest.java index 33703971b66b..ac24e4738b19 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/ImmutableMapTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/ImmutableMapTest.java @@ -21,7 +21,7 @@ import java.util.Collections; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for the ImmutableMapTest class. diff --git a/utils/src/test/java/software/amazon/awssdk/utils/IoUtilsTest.java b/utils/src/test/java/software/amazon/awssdk/utils/IoUtilsTest.java index b3e5f499d2c1..0c3218f69129 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/IoUtilsTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/IoUtilsTest.java @@ -22,7 +22,7 @@ import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.Random; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class IoUtilsTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/Md5UtilsTest.java b/utils/src/test/java/software/amazon/awssdk/utils/Md5UtilsTest.java index 0df5a8e4c3e7..9d976f810701 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/Md5UtilsTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/Md5UtilsTest.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import org.apache.commons.io.FileUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.utils.internal.Base16; public class Md5UtilsTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/NumericUtilsTest.java b/utils/src/test/java/software/amazon/awssdk/utils/NumericUtilsTest.java index 5f4a54b8f279..0c195b6360cb 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/NumericUtilsTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/NumericUtilsTest.java @@ -17,7 +17,7 @@ import java.time.Duration; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.*; diff --git a/utils/src/test/java/software/amazon/awssdk/utils/PairTest.java b/utils/src/test/java/software/amazon/awssdk/utils/PairTest.java index 08ce26e62997..4d0f590fe928 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/PairTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/PairTest.java @@ -20,7 +20,7 @@ import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class PairTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/SdkHttpUtilsTest.java b/utils/src/test/java/software/amazon/awssdk/utils/SdkHttpUtilsTest.java index e514974efc90..8d7e98916733 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/SdkHttpUtilsTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/SdkHttpUtilsTest.java @@ -23,14 +23,13 @@ import java.net.URI; import java.net.URISyntaxException; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.utils.http.SdkHttpUtils; public class SdkHttpUtilsTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/SystemSettingTest.java b/utils/src/test/java/software/amazon/awssdk/utils/SystemSettingTest.java index 0b3b413c0367..f4941a634a2e 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/SystemSettingTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/SystemSettingTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.utils; import static org.assertj.core.api.Java6Assertions.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class SystemSettingTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/ThreadFactoryBuilderTest.java b/utils/src/test/java/software/amazon/awssdk/utils/ThreadFactoryBuilderTest.java index 679e05fa8401..4a4987305642 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/ThreadFactoryBuilderTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/ThreadFactoryBuilderTest.java @@ -18,12 +18,12 @@ import static org.assertj.core.api.Java6Assertions.assertThat; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; public class ThreadFactoryBuilderTest { - @Before + @BeforeEach public void setup() { ThreadFactoryBuilder.resetPoolNumber(); } diff --git a/utils/src/test/java/software/amazon/awssdk/utils/ToStringTest.java b/utils/src/test/java/software/amazon/awssdk/utils/ToStringTest.java index 815b1c5c03b2..613d4bceb123 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/ToStringTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/ToStringTest.java @@ -19,7 +19,7 @@ import java.util.Arrays; import java.util.Collections; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Validate the functionality of {@link ToString}. diff --git a/utils/src/test/java/software/amazon/awssdk/utils/UserHomeDirectoryUtilsTest.java b/utils/src/test/java/software/amazon/awssdk/utils/UserHomeDirectoryUtilsTest.java index a77acc529bc0..0165bc5664d0 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/UserHomeDirectoryUtilsTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/UserHomeDirectoryUtilsTest.java @@ -22,9 +22,9 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -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 software.amazon.awssdk.testutils.EnvironmentVariableHelper; public class UserHomeDirectoryUtilsTest { @@ -42,7 +42,7 @@ public class UserHomeDirectoryUtilsTest { * Save the current state of the environment variables we're messing around with in these tests so that we can restore them * when we are done. */ - @Before + @BeforeEach public void saveEnvironment() throws Exception { // The tests in this file change the os.home for testing windows vs non-windows loading. We need to load the home // directory that should be used for the stored file before changing the os.home so that it doesn't try to load @@ -57,7 +57,7 @@ public void saveEnvironment() throws Exception { /** * Reset the environment variables after each test. */ - @After + @AfterEach public void restoreEnvironment() throws Exception { for (String variable : SAVED_ENVIRONMENT_VARIABLES) { String savedValue = savedEnvironmentVariableValues.get(variable); diff --git a/utils/src/test/java/software/amazon/awssdk/utils/async/FlatteningSubscriberTest.java b/utils/src/test/java/software/amazon/awssdk/utils/async/FlatteningSubscriberTest.java index fc03fdead024..4f8639fd544e 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/async/FlatteningSubscriberTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/async/FlatteningSubscriberTest.java @@ -18,8 +18,8 @@ import static org.mockito.Mockito.times; import java.util.Arrays; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.reactivestreams.Subscriber; @@ -30,7 +30,7 @@ public class FlatteningSubscriberTest { private Subscription mockUpstream; private FlatteningSubscriber flatteningSubscriber; - @Before + @BeforeEach @SuppressWarnings("unchecked") public void setup() { mockDelegate = Mockito.mock(Subscriber.class); diff --git a/utils/src/test/java/software/amazon/awssdk/utils/builder/CopyableBuilderTest.java b/utils/src/test/java/software/amazon/awssdk/utils/builder/CopyableBuilderTest.java index 3583437f33e1..136f0a473ded 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/builder/CopyableBuilderTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/builder/CopyableBuilderTest.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 CopyableBuilderTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/cache/CachedSupplierTest.java b/utils/src/test/java/software/amazon/awssdk/utils/cache/CachedSupplierTest.java index dcd393b5f3c8..425c9811a02b 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/cache/CachedSupplierTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/cache/CachedSupplierTest.java @@ -29,10 +29,10 @@ import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.function.Supplier; -import org.junit.After; +import org.junit.jupiter.api.AfterEach; import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * Validate the functionality of {@link CachedSupplier}. @@ -53,7 +53,7 @@ public class CachedSupplierTest { /** * Create an executor service for async testing. */ - @Before + @BeforeEach public void setup() { executorService = Executors.newFixedThreadPool(50); allExecutions = new ArrayList<>(); @@ -62,7 +62,7 @@ public void setup() { /** * Shut down the executor service when we're done. */ - @After + @AfterEach public void shutdown() { executorService.shutdown(); } diff --git a/utils/src/test/java/software/amazon/awssdk/utils/internal/ReflectionUtilsTest.java b/utils/src/test/java/software/amazon/awssdk/utils/internal/ReflectionUtilsTest.java index 96ed72b3e8f8..599b5ca6848d 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/internal/ReflectionUtilsTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/internal/ReflectionUtilsTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.is; import static org.junit.Assert.*; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class ReflectionUtilsTest { diff --git a/utils/src/test/java/software/amazon/awssdk/utils/internal/SystemSettingUtilsTest.java b/utils/src/test/java/software/amazon/awssdk/utils/internal/SystemSettingUtilsTest.java index 435b3ee157aa..37a3f958c038 100644 --- a/utils/src/test/java/software/amazon/awssdk/utils/internal/SystemSettingUtilsTest.java +++ b/utils/src/test/java/software/amazon/awssdk/utils/internal/SystemSettingUtilsTest.java @@ -16,7 +16,7 @@ package software.amazon.awssdk.utils.internal; import static org.assertj.core.api.Java6Assertions.assertThat; -import org.junit.Test; +import org.junit.jupiter.api.Test; import software.amazon.awssdk.utils.SystemSetting; public class SystemSettingUtilsTest {