From d0ab94718eb15af2f0b6681fee1d56bde4a500c5 Mon Sep 17 00:00:00 2001 From: ndr_brt Date: Wed, 16 Oct 2024 17:05:10 +0200 Subject: [PATCH 1/3] ci(test): avoid use of deprecated class --- .../transfer/test/AzureToAzureTest.java | 31 ++++++------- .../transfer/test/AzuriteContainer.java | 44 ++++++++++++++++++ .../transfer/test/MultiCloudTest.java | 27 ++++------- .../transfer/test/TestConstants.java | 14 +++--- .../edc/tests/transfer/AzureBlobHelper.java | 2 +- .../transfer/AzureToAzureEndToEndTest.java | 35 ++++++-------- .../edc/tests/transfer/AzuriteContainer.java | 46 +++++++++++++++++++ 7 files changed, 135 insertions(+), 64 deletions(-) create mode 100644 edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzuriteContainer.java create mode 100644 edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzuriteContainer.java diff --git a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzureToAzureTest.java b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzureToAzureTest.java index ac21a5d33..a47b99923 100644 --- a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzureToAzureTest.java +++ b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzureToAzureTest.java @@ -35,7 +35,6 @@ import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import org.testcontainers.containers.FixedHostPortGenericContainer; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; @@ -52,17 +51,13 @@ import static org.eclipse.edc.spi.constants.CoreConstants.EDC_NAMESPACE; import static org.eclipse.edc.spi.types.domain.transfer.DataFlowStartMessage.EDC_DATA_FLOW_START_MESSAGE_TYPE; import static org.eclipse.edc.util.io.Ports.getFreePort; -import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_CONSUMER_ACCOUNT_KEY; -import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_CONSUMER_ACCOUNT_NAME; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_CONSUMER_CONTAINER_NAME; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_CONSUMER_KEY_ALIAS; -import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_PROVIDER_ACCOUNT_KEY; -import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_PROVIDER_ACCOUNT_NAME; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_PROVIDER_CONTAINER_NAME; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_PROVIDER_KEY_ALIAS; -import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZURITE_CONTAINER_PORT; -import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZURITE_DOCKER_IMAGE; +import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.CONSUMER_AZURITE_ACCOUNT; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.PREFIX_FOR_MUTIPLE_FILES; +import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.PROVIDER_AZURITE_ACCOUNT; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.TESTFILE_NAME; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.blobDestinationAddress; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.blobSourceAddress; @@ -92,22 +87,22 @@ public class AzureToAzureTest { RuntimeConfig.Azure.blobstoreDataplaneConfig("/control", PROVIDER_CONTROL_PORT, AZURITE_HOST_PORT), ":edc-tests:runtime:dataplane-cloud" )).registerServiceMock(Monitor.class, spy(new ConsoleMonitor("AzureBlob-Dataplane", ConsoleMonitor.Level.DEBUG, true))); + /** * Currently we have to use one container to host both consumer and provider accounts, because we cannot handle * two different endpoint templates for provider and consumer. Endpoint templates are configured globally. * Also, the host-port must be fixed/deterministic, as the {@code PROVIDER_RUNTIME} needs to know it in advance */ @Container - private final FixedHostPortGenericContainer azuriteContainer = new FixedHostPortGenericContainer<>(AZURITE_DOCKER_IMAGE) - .withFixedExposedPort(AZURITE_HOST_PORT, AZURITE_CONTAINER_PORT) - .withEnv("AZURITE_ACCOUNTS", AZBLOB_PROVIDER_ACCOUNT_NAME + ":" + AZBLOB_PROVIDER_ACCOUNT_KEY + ";" + AZBLOB_CONSUMER_ACCOUNT_NAME + ":" + AZBLOB_CONSUMER_ACCOUNT_KEY); + private final AzuriteContainer azuriteContainer = new AzuriteContainer(AZURITE_HOST_PORT, PROVIDER_AZURITE_ACCOUNT, CONSUMER_AZURITE_ACCOUNT); + private AzureBlobHelper providerBlobHelper; private AzureBlobHelper consumerBlobHelper; @BeforeEach void setup() { - providerBlobHelper = new AzureBlobHelper(AZBLOB_PROVIDER_ACCOUNT_NAME, AZBLOB_PROVIDER_ACCOUNT_KEY, azuriteContainer.getHost(), azuriteContainer.getMappedPort(AZURITE_CONTAINER_PORT)); - consumerBlobHelper = new AzureBlobHelper(AZBLOB_CONSUMER_ACCOUNT_NAME, AZBLOB_CONSUMER_ACCOUNT_KEY, azuriteContainer.getHost(), azuriteContainer.getMappedPort(AZURITE_CONTAINER_PORT)); + providerBlobHelper = azuriteContainer.getHelper(PROVIDER_AZURITE_ACCOUNT); + consumerBlobHelper = azuriteContainer.getHelper(CONSUMER_AZURITE_ACCOUNT); } @Test @@ -120,7 +115,7 @@ void transferMultipleFile_success(Vault vault) { fileNames.forEach(filename -> providerBlobHelper.uploadBlob(sourceContainer, fileData, filename)); consumerBlobHelper.createContainer(AZBLOB_CONSUMER_CONTAINER_NAME); - vault.storeSecret(AZBLOB_PROVIDER_KEY_ALIAS, AZBLOB_PROVIDER_ACCOUNT_KEY); + vault.storeSecret(AZBLOB_PROVIDER_KEY_ALIAS, PROVIDER_AZURITE_ACCOUNT.key()); vault.storeSecret(AZBLOB_CONSUMER_KEY_ALIAS, """ {"sas": "%s","edctype":"dataspaceconnector:azuretoken"} """.formatted(consumerBlobHelper.generateAccountSas(AZBLOB_CONSUMER_CONTAINER_NAME))); @@ -157,7 +152,7 @@ void transferFile_success(Vault vault) { // create container in consumer's blob store consumerBlobHelper.createContainer(AZBLOB_CONSUMER_CONTAINER_NAME); - vault.storeSecret(AZBLOB_PROVIDER_KEY_ALIAS, AZBLOB_PROVIDER_ACCOUNT_KEY); + vault.storeSecret(AZBLOB_PROVIDER_KEY_ALIAS, PROVIDER_AZURITE_ACCOUNT.key()); vault.storeSecret(AZBLOB_CONSUMER_KEY_ALIAS, """ {"sas": "%s","edctype":"dataspaceconnector:azuretoken"} """.formatted(consumerBlobHelper.generateAccountSas(AZBLOB_CONSUMER_CONTAINER_NAME))); @@ -205,7 +200,7 @@ void transferFile_largeFile(long sizeBytes, Vault vault) throws IOException { // create container in consumer's blob store consumerBlobHelper.createContainer(AZBLOB_CONSUMER_CONTAINER_NAME); - vault.storeSecret(AZBLOB_PROVIDER_KEY_ALIAS, AZBLOB_PROVIDER_ACCOUNT_KEY); + vault.storeSecret(AZBLOB_PROVIDER_KEY_ALIAS, PROVIDER_AZURITE_ACCOUNT.key()); vault.storeSecret(AZBLOB_CONSUMER_KEY_ALIAS, """ {"sas": "%s","edctype":"dataspaceconnector:azuretoken"} """.formatted(consumerBlobHelper.generateAccountSas(AZBLOB_CONSUMER_CONTAINER_NAME))); @@ -231,7 +226,7 @@ void transferFile_largeFile(long sizeBytes, Vault vault) throws IOException { @Test void transferFolder_targetFolderNotExists_shouldCreate(Vault vault) { - vault.storeSecret(AZBLOB_PROVIDER_KEY_ALIAS, AZBLOB_PROVIDER_ACCOUNT_KEY); + vault.storeSecret(AZBLOB_PROVIDER_KEY_ALIAS, PROVIDER_AZURITE_ACCOUNT.key()); var sas = consumerBlobHelper.generateAccountSas(AZBLOB_CONSUMER_CONTAINER_NAME); vault.storeSecret(AZBLOB_CONSUMER_KEY_ALIAS, """ {"sas": "%s","edctype":"dataspaceconnector:azuretoken"} @@ -275,7 +270,7 @@ void transferFile_targetContainerNotExist_shouldFail(Vault vault) { providerBlobHelper.uploadBlob(sourceContainer, fileData, TESTFILE_NAME); - vault.storeSecret(AZBLOB_PROVIDER_KEY_ALIAS, AZBLOB_PROVIDER_ACCOUNT_KEY); + vault.storeSecret(AZBLOB_PROVIDER_KEY_ALIAS, PROVIDER_AZURITE_ACCOUNT.key()); vault.storeSecret(AZBLOB_CONSUMER_KEY_ALIAS, """ {"sas": "%s","edctype":"dataspaceconnector:azuretoken"} """.formatted(consumerBlobHelper.generateAccountSas(AZBLOB_CONSUMER_CONTAINER_NAME))); @@ -292,7 +287,7 @@ void transferFile_targetContainerNotExist_shouldFail(Vault vault) { await().pollInterval(Duration.ofSeconds(2)) .atMost(Duration.ofSeconds(10)) .untilAsserted(() -> verify(DATAPLANE_RUNTIME.getService(Monitor.class)) - .severe(contains("Error creating blob %s on account %s".formatted(TESTFILE_NAME, AZBLOB_CONSUMER_ACCOUNT_NAME)), isA(IOException.class))); + .severe(contains("Error creating blob %s on account %s".formatted(TESTFILE_NAME, CONSUMER_AZURITE_ACCOUNT.name())), isA(IOException.class))); } private JsonObjectBuilder createFlowRequestBuilder(String blobName) { diff --git a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzuriteContainer.java b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzuriteContainer.java new file mode 100644 index 000000000..1bc2e3b20 --- /dev/null +++ b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzuriteContainer.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 Cofinity-X + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.eclipse.tractusx.edc.dataplane.transfer.test; + +import org.testcontainers.containers.GenericContainer; + +import java.util.Arrays; +import java.util.List; + +import static java.util.stream.Collectors.joining; +import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZURITE_CONTAINER_PORT; + +public class AzuriteContainer extends GenericContainer { + + public AzuriteContainer(int azuriteHostPort, Account... accounts) { + super(TestConstants.AZURITE_DOCKER_IMAGE); + var azuriteAccounts = Arrays.stream(accounts).map(it -> "%s:%s".formatted(it.name, it.key)).collect(joining(";")); + addEnv("AZURITE_ACCOUNTS", azuriteAccounts); + setPortBindings(List.of("%d:10000".formatted(azuriteHostPort))); + } + + public AzureBlobHelper getHelper(Account account) { + return new AzureBlobHelper(account.name(), account.key(), getHost(), getMappedPort(AZURITE_CONTAINER_PORT)); + } + + public record Account(String name, String key) { } +} diff --git a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/MultiCloudTest.java b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/MultiCloudTest.java index 6eadf03ec..9547ecf2a 100644 --- a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/MultiCloudTest.java +++ b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/MultiCloudTest.java @@ -35,7 +35,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -import org.testcontainers.containers.FixedHostPortGenericContainer; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; import software.amazon.awssdk.regions.Region; @@ -55,10 +54,9 @@ import static org.eclipse.edc.spi.constants.CoreConstants.EDC_NAMESPACE; import static org.eclipse.edc.spi.types.domain.transfer.DataFlowStartMessage.EDC_DATA_FLOW_START_MESSAGE_TYPE; import static org.eclipse.edc.util.io.Ports.getFreePort; -import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_CONSUMER_ACCOUNT_KEY; -import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_CONSUMER_ACCOUNT_NAME; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_CONSUMER_CONTAINER_NAME; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.AZBLOB_CONSUMER_KEY_ALIAS; +import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.CONSUMER_AZURITE_ACCOUNT; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.PREFIX_FOR_MUTIPLE_FILES; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.S3_CONSUMER_BUCKET_NAME; import static org.eclipse.tractusx.edc.dataplane.transfer.test.TestConstants.TESTFILE_NAME; @@ -73,9 +71,6 @@ public class MultiCloudTest { public static final String BUCKET_NAME = S3_CONSUMER_BUCKET_NAME; public static final String BLOB_KEY_ALIAS = AZBLOB_CONSUMER_KEY_ALIAS; - // Azure Blob test constants - private static final String BLOB_ACCOUNT_NAME = AZBLOB_CONSUMER_ACCOUNT_NAME; - private static final String BLOB_ACCOUNT_KEY = AZBLOB_CONSUMER_ACCOUNT_KEY; private static final int AZURITE_HOST_PORT = getFreePort(); private static final String BLOB_CONTAINER_NAME = AZBLOB_CONSUMER_CONTAINER_NAME; @@ -93,9 +88,7 @@ public class MultiCloudTest { private final MinioContainer s3Container = new MinioContainer(); @Container - private final FixedHostPortGenericContainer azuriteContainer = new FixedHostPortGenericContainer<>(TestConstants.AZURITE_DOCKER_IMAGE) - .withFixedExposedPort(AZURITE_HOST_PORT, 10000) - .withEnv("AZURITE_ACCOUNTS", BLOB_ACCOUNT_NAME + ":" + BLOB_ACCOUNT_KEY); + private final AzuriteContainer azuriteContainer = new AzuriteContainer(AZURITE_HOST_PORT, CONSUMER_AZURITE_ACCOUNT); private AzureBlobHelper blobStoreHelper; private S3Client s3Client; @@ -103,7 +96,7 @@ public class MultiCloudTest { @BeforeEach void setup() { - blobStoreHelper = new AzureBlobHelper(BLOB_ACCOUNT_NAME, BLOB_ACCOUNT_KEY, azuriteContainer.getHost(), azuriteContainer.getMappedPort(10000)); + blobStoreHelper = azuriteContainer.getHelper(CONSUMER_AZURITE_ACCOUNT); s3EndpointOverride = "http://localhost:%s/".formatted(s3Container.getFirstMappedPort()); var providerConfig = AwsClientProviderConfiguration.Builder.newInstance() .endpointOverride(URI.create(s3EndpointOverride)) @@ -121,7 +114,7 @@ void transferFile_azureToS3MultipleFiles(Vault vault) { var fileNames = IntStream.rangeClosed(1, 2).mapToObj(i -> PREFIX_FOR_MUTIPLE_FILES + i + '_' + TESTFILE_NAME).toList(); fileNames.forEach(filename -> blobStoreHelper.uploadBlob(sourceContainer, fileData, filename)); - vault.storeSecret(BLOB_KEY_ALIAS, BLOB_ACCOUNT_KEY); + vault.storeSecret(BLOB_KEY_ALIAS, CONSUMER_AZURITE_ACCOUNT.key()); var destinationBucket = s3Client.createBucket(CreateBucketRequest.builder().bucket(BUCKET_NAME).build()); assertThat(destinationBucket.sdkHttpResponse().isSuccessful()).isTrue(); @@ -135,7 +128,7 @@ void transferFile_azureToS3MultipleFiles(Vault vault) { .add("dspace:endpointType", "AzureStorage") .add("dspace:endpointProperties", Json.createArrayBuilder() .add(dspaceProperty(EDC_NAMESPACE + "container", BLOB_CONTAINER_NAME)) - .add(dspaceProperty(EDC_NAMESPACE + "account", BLOB_ACCOUNT_NAME)) + .add(dspaceProperty(EDC_NAMESPACE + "account", CONSUMER_AZURITE_ACCOUNT.name())) .add(dspaceProperty(EDC_NAMESPACE + "keyName", BLOB_KEY_ALIAS)) .add(dspaceProperty(EDC_NAMESPACE + "blobPrefix", PREFIX_FOR_MUTIPLE_FILES)) ) @@ -176,7 +169,7 @@ void transferFile_azureToS3(Vault vault) { var fileData = BinaryData.fromString(TestUtils.getResourceFileContentAsString(TESTFILE_NAME)); var sourceContainer = blobStoreHelper.createContainer(BLOB_CONTAINER_NAME); blobStoreHelper.uploadBlob(sourceContainer, fileData, TESTFILE_NAME); - vault.storeSecret(BLOB_KEY_ALIAS, BLOB_ACCOUNT_KEY); + vault.storeSecret(BLOB_KEY_ALIAS, CONSUMER_AZURITE_ACCOUNT.key()); var r = s3Client.createBucket(CreateBucketRequest.builder().bucket(BUCKET_NAME).build()); assertThat(r.sdkHttpResponse().isSuccessful()).isTrue(); @@ -190,7 +183,7 @@ void transferFile_azureToS3(Vault vault) { .add("dspace:endpointType", "AzureStorage") .add("dspace:endpointProperties", Json.createArrayBuilder() .add(dspaceProperty(EDC_NAMESPACE + "container", BLOB_CONTAINER_NAME)) - .add(dspaceProperty(EDC_NAMESPACE + "account", BLOB_ACCOUNT_NAME)) + .add(dspaceProperty(EDC_NAMESPACE + "account", CONSUMER_AZURITE_ACCOUNT.name())) .add(dspaceProperty(EDC_NAMESPACE + "keyName", BLOB_KEY_ALIAS)) .add(dspaceProperty(EDC_NAMESPACE + "blobName", TESTFILE_NAME)) ) @@ -268,7 +261,7 @@ void transferFile_s3ToAzureMultipleFiles(Vault vault) { .add("dspace:endpointType", "AzureStorage") .add("dspace:endpointProperties", Json.createArrayBuilder() .add(dspaceProperty(EDC_NAMESPACE + "container", AZBLOB_CONSUMER_CONTAINER_NAME)) - .add(dspaceProperty(EDC_NAMESPACE + "account", AZBLOB_CONSUMER_ACCOUNT_NAME)) + .add(dspaceProperty(EDC_NAMESPACE + "account", CONSUMER_AZURITE_ACCOUNT.name())) .add(dspaceProperty(EDC_NAMESPACE + "keyName", AZBLOB_CONSUMER_KEY_ALIAS)) ) ) @@ -334,7 +327,7 @@ void transferFile_s3ToAzureMultipleFiles_whenConsumerDefinesBloblName_success(Va .add("dspace:endpointType", "AzureStorage") .add("dspace:endpointProperties", Json.createArrayBuilder() .add(dspaceProperty(EDC_NAMESPACE + "container", AZBLOB_CONSUMER_CONTAINER_NAME)) - .add(dspaceProperty(EDC_NAMESPACE + "account", AZBLOB_CONSUMER_ACCOUNT_NAME)) + .add(dspaceProperty(EDC_NAMESPACE + "account", CONSUMER_AZURITE_ACCOUNT.name())) .add(dspaceProperty(EDC_NAMESPACE + "keyName", AZBLOB_CONSUMER_KEY_ALIAS)) .add(dspaceProperty(EDC_NAMESPACE + "blobName", "NOME_TEST")) ) @@ -391,7 +384,7 @@ void transferFile_s3ToAzure(Vault vault) { .add("dspace:endpointType", "AzureStorage") .add("dspace:endpointProperties", Json.createArrayBuilder() .add(dspaceProperty(EDC_NAMESPACE + "container", AZBLOB_CONSUMER_CONTAINER_NAME)) - .add(dspaceProperty(EDC_NAMESPACE + "account", AZBLOB_CONSUMER_ACCOUNT_NAME)) + .add(dspaceProperty(EDC_NAMESPACE + "account", CONSUMER_AZURITE_ACCOUNT.name())) .add(dspaceProperty(EDC_NAMESPACE + "keyName", AZBLOB_CONSUMER_KEY_ALIAS)) .add(dspaceProperty(EDC_NAMESPACE + "blobName", TESTFILE_NAME)) ) diff --git a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/TestConstants.java b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/TestConstants.java index eb8cc0c77..46d45adb8 100644 --- a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/TestConstants.java +++ b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/TestConstants.java @@ -31,10 +31,8 @@ public class TestConstants { // AZURE BLOB CONSTANTS public static final String AZURITE_DOCKER_IMAGE = "mcr.microsoft.com/azure-storage/azurite"; public static final int AZURITE_CONTAINER_PORT = 10000; - public static final String AZBLOB_PROVIDER_ACCOUNT_NAME = "provider"; - public static final String AZBLOB_PROVIDER_ACCOUNT_KEY = "providerkey"; - public static final String AZBLOB_CONSUMER_ACCOUNT_NAME = "consumer"; - public static final String AZBLOB_CONSUMER_ACCOUNT_KEY = "consumerkey"; + public static final AzuriteContainer.Account PROVIDER_AZURITE_ACCOUNT = new AzuriteContainer.Account("provider", "providerkey"); + public static final AzuriteContainer.Account CONSUMER_AZURITE_ACCOUNT = new AzuriteContainer.Account("consumer", "consumerkey"); // alias under which the provider key is stored in the vault. must end with -key1 public static final String AZBLOB_PROVIDER_KEY_ALIAS = "provider-key1"; // alias under which the consumer key is stored in the vault. must end with -key1 @@ -54,8 +52,8 @@ public static JsonObjectBuilder blobSourceAddress(List additi .add("dspace:endpointType", "AzureStorage") .add("dspace:endpointProperties", Json.createArrayBuilder(additionalProperties) .add(dspaceProperty(EDC_NAMESPACE + "container", AZBLOB_PROVIDER_CONTAINER_NAME)) - .add(dspaceProperty(EDC_NAMESPACE + "account", AZBLOB_PROVIDER_ACCOUNT_NAME)) - .add(dspaceProperty(EDC_NAMESPACE + "keyName", AZBLOB_PROVIDER_KEY_ALIAS)) + .add(dspaceProperty(EDC_NAMESPACE + "account", PROVIDER_AZURITE_ACCOUNT.name())) + .add(dspaceProperty(EDC_NAMESPACE + "keyName", PROVIDER_AZURITE_ACCOUNT.key())) ); } @@ -64,8 +62,8 @@ public static JsonObjectBuilder blobDestinationAddress(List a .add("dspace:endpointType", "AzureStorage") .add("dspace:endpointProperties", Json.createArrayBuilder(additionalProperties) .add(dspaceProperty(EDC_NAMESPACE + "container", AZBLOB_CONSUMER_CONTAINER_NAME)) - .add(dspaceProperty(EDC_NAMESPACE + "account", AZBLOB_CONSUMER_ACCOUNT_NAME)) - .add(dspaceProperty(EDC_NAMESPACE + "keyName", AZBLOB_CONSUMER_KEY_ALIAS)) + .add(dspaceProperty(EDC_NAMESPACE + "account", CONSUMER_AZURITE_ACCOUNT.name())) + .add(dspaceProperty(EDC_NAMESPACE + "keyName", CONSUMER_AZURITE_ACCOUNT.key())) ); } diff --git a/edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzureBlobHelper.java b/edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzureBlobHelper.java index 81da3a164..15a609098 100644 --- a/edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzureBlobHelper.java +++ b/edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzureBlobHelper.java @@ -32,7 +32,7 @@ /** * Helper class that internally uses Azure SDK classes to create containers, upload blobs, generate SAS tokens, etc. */ -class AzureBlobHelper { +public class AzureBlobHelper { private final String accountName; private final String key; private final String host; diff --git a/edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzureToAzureEndToEndTest.java b/edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzureToAzureEndToEndTest.java index 37a48f18a..3b00ec544 100644 --- a/edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzureToAzureEndToEndTest.java +++ b/edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzureToAzureEndToEndTest.java @@ -30,7 +30,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -import org.testcontainers.containers.FixedHostPortGenericContainer; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; @@ -77,16 +76,12 @@ public class AzureToAzureEndToEndTest { protected static final RuntimeExtension PROVIDER_RUNTIME = memoryRuntime(PROVIDER.getName(), PROVIDER.getBpn(), with(PROVIDER.getConfiguration(), AZURITE_HOST_PORT)); @RegisterExtension protected static final RuntimeExtension CONSUMER_RUNTIME = memoryRuntime(CONSUMER.getName(), CONSUMER.getBpn(), with(CONSUMER.getConfiguration(), AZURITE_HOST_PORT)); - private static final String AZBLOB_PROVIDER_ACCOUNT_NAME = "provider"; - private static final String AZBLOB_CONSUMER_ACCOUNT_NAME = "consumer"; - private static final String AZBLOB_PROVIDER_ACCOUNT_KEY = Base64.encodeBase64String("provider-key".getBytes()); - private static final String AZBLOB_CONSUMER_ACCOUNT_KEY = Base64.encodeBase64String("provider-key".getBytes()); - private static final int AZURITE_CONTAINER_PORT = 10000; private static final String TESTFILE_NAME = "hello.txt"; + + private final AzuriteContainer.Account providerAzuriteAccount = new AzuriteContainer.Account("provider", Base64.encodeBase64String("provider-key".getBytes())); + private final AzuriteContainer.Account consumerAzuriteAccount = new AzuriteContainer.Account("consumer", Base64.encodeBase64String("consumer-key".getBytes())); @Container - private final FixedHostPortGenericContainer azuriteContainer = new FixedHostPortGenericContainer<>(AZURITE_DOCKER_IMAGE) - .withFixedExposedPort(AZURITE_HOST_PORT, AZURITE_CONTAINER_PORT) - .withEnv("AZURITE_ACCOUNTS", AZBLOB_PROVIDER_ACCOUNT_NAME + ":" + AZBLOB_PROVIDER_ACCOUNT_KEY + ";" + AZBLOB_CONSUMER_ACCOUNT_NAME + ":" + AZBLOB_CONSUMER_ACCOUNT_KEY); + private final AzuriteContainer azuriteContainer = new AzuriteContainer(AZURITE_HOST_PORT, providerAzuriteAccount, consumerAzuriteAccount); private AzureBlobHelper providerBlobHelper; private AzureBlobHelper consumerBlobHelper; @@ -110,13 +105,13 @@ public TractusxParticipantBase consumer() { @BeforeEach void setup() { PROVIDER_RUNTIME.getService(Vault.class) - .storeSecret(PROVIDER_KEY_ALIAS, AZBLOB_PROVIDER_ACCOUNT_KEY); + .storeSecret(PROVIDER_KEY_ALIAS, providerAzuriteAccount.key()); CONSUMER_RUNTIME.getService(Vault.class) - .storeSecret("%s-key1".formatted(AZBLOB_CONSUMER_ACCOUNT_NAME), AZBLOB_CONSUMER_ACCOUNT_KEY); + .storeSecret("%s-key1".formatted(consumerAzuriteAccount.name()), consumerAzuriteAccount.key()); - providerBlobHelper = new AzureBlobHelper(AZBLOB_PROVIDER_ACCOUNT_NAME, AZBLOB_PROVIDER_ACCOUNT_KEY, azuriteContainer.getHost(), azuriteContainer.getMappedPort(AZURITE_CONTAINER_PORT)); - consumerBlobHelper = new AzureBlobHelper(AZBLOB_CONSUMER_ACCOUNT_NAME, AZBLOB_CONSUMER_ACCOUNT_KEY, azuriteContainer.getHost(), azuriteContainer.getMappedPort(AZURITE_CONTAINER_PORT)); + providerBlobHelper = azuriteContainer.getHelper(providerAzuriteAccount); + consumerBlobHelper = azuriteContainer.getHelper(consumerAzuriteAccount); } @Test @@ -128,7 +123,7 @@ void azureBlobPush_withDestFolder() { "@type", "DataAddress", "type", "AzureStorage", "container", PROVIDER_CONTAINER_NAME, - "account", AZBLOB_PROVIDER_ACCOUNT_NAME, + "account", providerAzuriteAccount.name(), "blobPrefix", "folder/", "keyName", PROVIDER_KEY_ALIAS ); @@ -150,7 +145,7 @@ void azureBlobPush_withDestFolder() { .add(EDC_NAMESPACE + "type", "AzureStorage") .add(EDC_NAMESPACE + "properties", createObjectBuilder() .add(EDC_NAMESPACE + "type", "AzureStorage") - .add(EDC_NAMESPACE + "account", AZBLOB_CONSUMER_ACCOUNT_NAME) + .add(EDC_NAMESPACE + "account", consumerAzuriteAccount.name()) .add(EDC_NAMESPACE + "container", CONSUMER_CONTAINER_NAME) .add(EDC_NAMESPACE + "folderName", destfolder) .build()) @@ -180,7 +175,7 @@ void azureBlobPush_withoutDestFolder() { "@type", "DataAddress", "type", "AzureStorage", "container", PROVIDER_CONTAINER_NAME, - "account", AZBLOB_PROVIDER_ACCOUNT_NAME, + "account", providerAzuriteAccount.name(), "blobPrefix", "folder/", "keyName", PROVIDER_KEY_ALIAS ); @@ -201,7 +196,7 @@ void azureBlobPush_withoutDestFolder() { .add(EDC_NAMESPACE + "type", "AzureStorage") .add(EDC_NAMESPACE + "properties", createObjectBuilder() .add(EDC_NAMESPACE + "type", "AzureStorage") - .add(EDC_NAMESPACE + "account", AZBLOB_CONSUMER_ACCOUNT_NAME) + .add(EDC_NAMESPACE + "account", consumerAzuriteAccount.name()) .add(EDC_NAMESPACE + "container", CONSUMER_CONTAINER_NAME) // .add(EDC_NAMESPACE + "folderName", destfolder) <-- no dest folder .build()) @@ -231,7 +226,7 @@ void azureBlobPush_containerNotExist() { "@type", "DataAddress", "type", "AzureStorage", "container", PROVIDER_CONTAINER_NAME, - "account", AZBLOB_PROVIDER_ACCOUNT_NAME, + "account", providerAzuriteAccount.name(), "blobPrefix", "folder/", "keyName", PROVIDER_KEY_ALIAS ); @@ -252,7 +247,7 @@ void azureBlobPush_containerNotExist() { .add(EDC_NAMESPACE + "type", "AzureStorage") .add(EDC_NAMESPACE + "properties", createObjectBuilder() .add(EDC_NAMESPACE + "type", "AzureStorage") - .add(EDC_NAMESPACE + "account", AZBLOB_CONSUMER_ACCOUNT_NAME) + .add(EDC_NAMESPACE + "account", consumerAzuriteAccount.name()) .add(EDC_NAMESPACE + "container", CONSUMER_CONTAINER_NAME) .build()) .build(); @@ -272,4 +267,4 @@ void azureBlobPush_containerNotExist() { }); } -} \ No newline at end of file +} diff --git a/edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzuriteContainer.java b/edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzuriteContainer.java new file mode 100644 index 000000000..1d41c0413 --- /dev/null +++ b/edc-tests/edc-end2end/end2end-transfer-cloud/src/test/java/org/eclipse/tractusx/edc/tests/transfer/AzuriteContainer.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2024 Cofinity-X + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Apache License, Version 2.0 which is available at + * https://www.apache.org/licenses/LICENSE-2.0. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.eclipse.tractusx.edc.tests.transfer; + +import org.testcontainers.containers.GenericContainer; + +import java.util.Arrays; +import java.util.List; + +import static java.util.stream.Collectors.joining; +import static org.eclipse.tractusx.edc.tests.transfer.AzureToAzureEndToEndTest.AZURITE_DOCKER_IMAGE; + +public class AzuriteContainer extends GenericContainer { + + private final int containerPort = 10_000; + + public AzuriteContainer(int azuriteHostPort, Account... accounts) { + super(AZURITE_DOCKER_IMAGE); + var azuriteAccounts = Arrays.stream(accounts).map(it -> "%s:%s".formatted(it.name, it.key)).collect(joining(";")); + addEnv("AZURITE_ACCOUNTS", azuriteAccounts); + setPortBindings(List.of("%d:%d".formatted(azuriteHostPort, containerPort))); + } + + public AzureBlobHelper getHelper(Account account) { + return new AzureBlobHelper(account.name(), account.key(), getHost(), getMappedPort(containerPort)); + } + + public record Account(String name, String key) { } +} From daf0cdb0e9ebe4be8a29633ea20ea4daa38764aa Mon Sep 17 00:00:00 2001 From: ndr_brt Date: Thu, 17 Oct 2024 08:35:15 +0200 Subject: [PATCH 2/3] dependencies --- DEPENDENCIES | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/DEPENDENCIES b/DEPENDENCIES index 7f955c414..416043500 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -6,22 +6,22 @@ maven/mavencentral/com.apicatalog/iron-verifiable-credentials/0.14.0, Apache-2.0 maven/mavencentral/com.apicatalog/titanium-json-ld/1.0.0, Apache-2.0, approved, clearlydefined maven/mavencentral/com.apicatalog/titanium-json-ld/1.4.0, Apache-2.0, approved, #15200 maven/mavencentral/com.apicatalog/titanium-json-ld/1.4.1, Apache-2.0, approved, #15200 -maven/mavencentral/com.azure/azure-core-http-netty/1.15.2, MIT, approved, clearlydefined -maven/mavencentral/com.azure/azure-core-http-netty/1.15.3, MIT, approved, clearlydefined -maven/mavencentral/com.azure/azure-core-http-netty/1.15.4, MIT, approved, clearlydefined -maven/mavencentral/com.azure/azure-core-http-netty/1.15.5, , restricted, clearlydefined +maven/mavencentral/com.azure/azure-core-http-netty/1.15.2, MIT AND Apache-2.0, approved, #16697 +maven/mavencentral/com.azure/azure-core-http-netty/1.15.3, MIT AND Apache-2.0, approved, #16697 +maven/mavencentral/com.azure/azure-core-http-netty/1.15.4, MIT AND Apache-2.0, approved, #16697 +maven/mavencentral/com.azure/azure-core-http-netty/1.15.5, MIT AND Apache-2.0, approved, #16697 maven/mavencentral/com.azure/azure-core/1.50.0, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-core/1.51.0, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-core/1.52.0, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-core/1.53.0, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-identity/1.13.2, MIT, approved, clearlydefined -maven/mavencentral/com.azure/azure-identity/1.14.0, , restricted, clearlydefined +maven/mavencentral/com.azure/azure-identity/1.14.0, MIT, approved, #16714 maven/mavencentral/com.azure/azure-json/1.2.0, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-json/1.3.0, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-security-keyvault-secrets/4.8.5, MIT, approved, #13690 maven/mavencentral/com.azure/azure-security-keyvault-secrets/4.8.7, MIT, approved, #13690 maven/mavencentral/com.azure/azure-storage-blob/12.28.0, MIT, approved, clearlydefined -maven/mavencentral/com.azure/azure-storage-blob/12.28.1, , restricted, clearlydefined +maven/mavencentral/com.azure/azure-storage-blob/12.28.1, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-storage-common/12.27.0, MIT, approved, clearlydefined maven/mavencentral/com.azure/azure-storage-common/12.27.1, , restricted, clearlydefined maven/mavencentral/com.azure/azure-storage-internal-avro/12.13.0, MIT, approved, clearlydefined @@ -105,7 +105,7 @@ maven/mavencentral/com.lmax/disruptor/3.4.4, Apache-2.0, approved, clearlydefine maven/mavencentral/com.microsoft.azure/msal4j-persistence-extension/1.3.0, MIT, approved, #14411 maven/mavencentral/com.microsoft.azure/msal4j/1.15.0, MIT, approved, clearlydefined maven/mavencentral/com.microsoft.azure/msal4j/1.16.2, MIT, approved, clearlydefined -maven/mavencentral/com.microsoft.azure/msal4j/1.17.2, , restricted, clearlydefined +maven/mavencentral/com.microsoft.azure/msal4j/1.17.2, MIT, approved, #16709 maven/mavencentral/com.networknt/json-schema-validator/1.0.76, Apache-2.0, approved, CQ22638 maven/mavencentral/com.nimbusds/content-type/2.3, Apache-2.0, approved, clearlydefined maven/mavencentral/com.nimbusds/lang-tag/1.7, Apache-2.0, approved, clearlydefined @@ -636,8 +636,8 @@ maven/mavencentral/org.slf4j/slf4j-api/2.0.6, MIT, approved, #5915 maven/mavencentral/org.slf4j/slf4j-api/2.0.9, MIT, approved, #5915 maven/mavencentral/org.testcontainers/database-commons/1.20.2, Apache-2.0, approved, #16630 maven/mavencentral/org.testcontainers/jdbc/1.20.2, Apache-2.0, approved, #16621 -maven/mavencentral/org.testcontainers/junit-jupiter/1.20.2, None, restricted, #16552 -maven/mavencentral/org.testcontainers/postgresql/1.20.2, None, restricted, #16627 +maven/mavencentral/org.testcontainers/junit-jupiter/1.20.2, MIT, approved, #16552 +maven/mavencentral/org.testcontainers/postgresql/1.20.2, MIT, approved, #16627 maven/mavencentral/org.testcontainers/testcontainers/1.20.2, MIT, approved, #15747 maven/mavencentral/org.xmlresolver/xmlresolver/5.2.2, Apache-2.0, approved, clearlydefined maven/mavencentral/org.xmlunit/xmlunit-core/2.9.1, Apache-2.0, approved, #6272 From 8b4657909b5c08301a26f3cb4ee37565f7ff2b7b Mon Sep 17 00:00:00 2001 From: ndr_brt Date: Thu, 17 Oct 2024 10:03:05 +0200 Subject: [PATCH 3/3] refactor test pipeline --- .github/workflows/verify.yaml | 34 ++++++------------ .../transfer/test/AzureToAzureTest.java | 3 +- .../transfer/test/CloudTransferTest.java | 35 ------------------- .../transfer/test/MultiCloudTest.java | 3 +- .../dataplane/transfer/test/S3ToS3Test.java | 3 +- .../transfer/test/TestConstants.java | 4 +-- 6 files changed, 18 insertions(+), 64 deletions(-) delete mode 100644 edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/CloudTransferTest.java diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index f0eacea42..700b14839 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -100,12 +100,15 @@ jobs: strategy: fail-fast: false matrix: - variant: [ { dir: edc-tests/edc-controlplane/catalog-tests }, - { dir: edc-tests/edc-controlplane/edr-api-tests }, - { dir: edc-tests/edc-controlplane/iatp-tests }, - { dir: edc-tests/edc-controlplane/policy-tests }, - { dir: edc-tests/edc-controlplane/transfer-tests }, - { dir: edc-tests/edc-dataplane/edc-dataplane-tokenrefresh-tests } + variant: [ + { dir: edc-tests/edc-controlplane/catalog-tests }, + { dir: edc-tests/edc-controlplane/edr-api-tests }, + { dir: edc-tests/edc-controlplane/iatp-tests }, + { dir: edc-tests/edc-controlplane/policy-tests }, + { dir: edc-tests/edc-controlplane/transfer-tests }, + { dir: edc-tests/edc-dataplane/edc-dataplane-tokenrefresh-tests }, + { dir: edc-tests/edc-dataplane/cloud-transfer-tests }, + { dir: edc-tests/edc-end2end }, ] steps: - uses: actions/checkout@v4 @@ -113,7 +116,7 @@ jobs: - name: Run E2E tests (${{ matrix.variant.dir }}) run: | - ./gradlew compileJava compileTestJava --refresh-dependencies + ./gradlew compileJava compileTestJava ./gradlew -p ${{ matrix.variant.dir }} test -DincludeTags="EndToEndTest" -PverboseTest=true postgres-tests: @@ -124,20 +127,3 @@ jobs: - name: Run Postgresql E2E tests run: ./gradlew test -DincludeTags="PostgresqlIntegrationTest" --refresh-dependencies - - cloud-transfer-tests: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-java - - - name: Run Azure/S3 dataplane tests - run: | - ./gradlew compileJava compileTestJava - ./gradlew -p edc-tests/edc-dataplane test -DincludeTags="CloudTransferTest" - - - name: Run Azure/S3 End-To-End tests - run: | - ./gradlew compileJava compileTestJava - ./gradlew -p edc-tests/edc-end2end test -DincludeTags="EndToEndTest" diff --git a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzureToAzureTest.java b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzureToAzureTest.java index a47b99923..2bffec3e3 100644 --- a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzureToAzureTest.java +++ b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/AzureToAzureTest.java @@ -23,6 +23,7 @@ import io.restassured.http.ContentType; import jakarta.json.Json; import jakarta.json.JsonObjectBuilder; +import org.eclipse.edc.junit.annotations.EndToEndTest; import org.eclipse.edc.junit.extensions.EmbeddedRuntime; import org.eclipse.edc.junit.extensions.RuntimeExtension; import org.eclipse.edc.junit.extensions.RuntimePerClassExtension; @@ -74,7 +75,7 @@ */ @SuppressWarnings("resource") @Testcontainers -@CloudTransferTest +@EndToEndTest public class AzureToAzureTest { private static final int PROVIDER_CONTROL_PORT = getFreePort(); diff --git a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/CloudTransferTest.java b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/CloudTransferTest.java deleted file mode 100644 index 7adafa32f..000000000 --- a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/CloudTransferTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.eclipse.tractusx.edc.dataplane.transfer.test; - -import org.eclipse.edc.junit.annotations.IntegrationTest; -import org.junit.jupiter.api.Tag; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Target({ ElementType.TYPE }) -@Retention(RetentionPolicy.RUNTIME) -@IntegrationTest -@Tag("CloudTransferTest") -public @interface CloudTransferTest { -} diff --git a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/MultiCloudTest.java b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/MultiCloudTest.java index 9547ecf2a..e11ab57ca 100644 --- a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/MultiCloudTest.java +++ b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/MultiCloudTest.java @@ -27,6 +27,7 @@ import org.eclipse.edc.aws.s3.AwsClientProviderImpl; import org.eclipse.edc.aws.s3.S3ClientRequest; import org.eclipse.edc.aws.s3.spi.S3BucketSchema; +import org.eclipse.edc.junit.annotations.EndToEndTest; import org.eclipse.edc.junit.extensions.EmbeddedRuntime; import org.eclipse.edc.junit.extensions.RuntimeExtension; import org.eclipse.edc.junit.extensions.RuntimePerClassExtension; @@ -64,7 +65,7 @@ import static org.testcontainers.shaded.org.awaitility.Awaitility.await; @Testcontainers -@CloudTransferTest +@EndToEndTest public class MultiCloudTest { // S3 test constants public static final String REGION = Region.US_WEST_2.id(); diff --git a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/S3ToS3Test.java b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/S3ToS3Test.java index b55495a45..1fce1e270 100644 --- a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/S3ToS3Test.java +++ b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/S3ToS3Test.java @@ -27,6 +27,7 @@ import org.eclipse.edc.aws.s3.AwsClientProviderImpl; import org.eclipse.edc.aws.s3.S3ClientRequest; import org.eclipse.edc.aws.s3.spi.S3BucketSchema; +import org.eclipse.edc.junit.annotations.EndToEndTest; import org.eclipse.edc.junit.extensions.EmbeddedRuntime; import org.eclipse.edc.junit.extensions.RuntimeExtension; import org.eclipse.edc.junit.extensions.RuntimePerClassExtension; @@ -82,7 +83,7 @@ * It spins up a fully-fledged dataplane and issues the DataFlowStartMessage via the data plane's Control API */ @Testcontainers -@CloudTransferTest +@EndToEndTest public class S3ToS3Test { private static final int PROVIDER_CONTROL_PORT = getFreePort(); // port of the control api diff --git a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/TestConstants.java b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/TestConstants.java index 46d45adb8..4899c12b1 100644 --- a/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/TestConstants.java +++ b/edc-tests/edc-dataplane/cloud-transfer-tests/src/test/java/org/eclipse/tractusx/edc/dataplane/transfer/test/TestConstants.java @@ -53,7 +53,7 @@ public static JsonObjectBuilder blobSourceAddress(List additi .add("dspace:endpointProperties", Json.createArrayBuilder(additionalProperties) .add(dspaceProperty(EDC_NAMESPACE + "container", AZBLOB_PROVIDER_CONTAINER_NAME)) .add(dspaceProperty(EDC_NAMESPACE + "account", PROVIDER_AZURITE_ACCOUNT.name())) - .add(dspaceProperty(EDC_NAMESPACE + "keyName", PROVIDER_AZURITE_ACCOUNT.key())) + .add(dspaceProperty(EDC_NAMESPACE + "keyName", AZBLOB_PROVIDER_KEY_ALIAS)) ); } @@ -63,7 +63,7 @@ public static JsonObjectBuilder blobDestinationAddress(List a .add("dspace:endpointProperties", Json.createArrayBuilder(additionalProperties) .add(dspaceProperty(EDC_NAMESPACE + "container", AZBLOB_CONSUMER_CONTAINER_NAME)) .add(dspaceProperty(EDC_NAMESPACE + "account", CONSUMER_AZURITE_ACCOUNT.name())) - .add(dspaceProperty(EDC_NAMESPACE + "keyName", CONSUMER_AZURITE_ACCOUNT.key())) + .add(dspaceProperty(EDC_NAMESPACE + "keyName", AZBLOB_CONSUMER_KEY_ALIAS)) ); }