Skip to content

Commit fc91ff1

Browse files
authored
build: fix and bump gradle (#408)
1 parent fa30441 commit fc91ff1

File tree

18 files changed

+47
-85
lines changed

18 files changed

+47
-85
lines changed

extensions/control-plane/store/asset-index-cosmos/src/test/java/org/eclipse/edc/connector/store/azure/cosmos/assetindex/CosmosAssetIndexTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ static void prepare(CosmosPostgresTestExtension.SqlHelper runner) {
4848
@AfterAll
4949
static void dropTables(CosmosPostgresTestExtension.SqlHelper runner) {
5050
runner.dropTable(SQL_STATEMENTS.getAssetTable());
51-
runner.dropTable(SQL_STATEMENTS.getDataAddressTable());
52-
runner.dropTable(SQL_STATEMENTS.getAssetPropertyTable());
5351
}
5452

5553
@BeforeEach
@@ -61,8 +59,6 @@ void setUp(TransactionContext transactionContext, QueryExecutor queryExecutor, C
6159
sqlAssetIndex = new SqlAssetIndex(reg, DEFAULT_DATASOURCE_NAME, transactionContext, new ObjectMapper(), SQL_STATEMENTS, queryExecutor);
6260

6361
runner.truncateTable(SQL_STATEMENTS.getAssetTable());
64-
runner.truncateTable(SQL_STATEMENTS.getDataAddressTable());
65-
runner.truncateTable(SQL_STATEMENTS.getAssetPropertyTable());
6662
}
6763

6864
@Override

extensions/data-plane/data-plane-azure-storage/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies {
2020
api(project(":extensions:common:azure:azure-blob-core"))
2121
api(libs.edc.core.dataPlane.util)
2222
api(libs.edc.spi.dataplane)
23+
api(libs.edc.spi.participant.context.single)
2324
implementation(libs.edc.core.dataPlane.util)
2425
implementation(libs.edc.lib.util)
2526

@@ -28,4 +29,4 @@ dependencies {
2829

2930
testImplementation(testFixtures(project(":extensions:common:azure:azure-test")))
3031
testImplementation(testFixtures(project(":extensions:common:azure:azure-blob-core")))
31-
}
32+
}

extensions/data-plane/data-plane-azure-storage/src/main/java/org/eclipse/edc/connector/dataplane/azure/storage/DataPlaneAzureStorageExtension.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.eclipse.edc.connector.dataplane.spi.pipeline.PipelineService;
2626
import org.eclipse.edc.runtime.metamodel.annotation.Extension;
2727
import org.eclipse.edc.runtime.metamodel.annotation.Inject;
28+
import org.eclipse.edc.runtime.metamodel.annotation.Setting;
2829
import org.eclipse.edc.spi.security.Vault;
2930
import org.eclipse.edc.spi.system.ServiceExtension;
3031
import org.eclipse.edc.spi.system.ServiceExtensionContext;
@@ -37,21 +38,20 @@
3738
public class DataPlaneAzureStorageExtension implements ServiceExtension {
3839

3940
public static final String NAME = "Data Plane Azure Storage";
40-
@Inject
41-
private RetryPolicy retryPolicy;
41+
42+
@Setting(description = "Configures the participant id this runtime is operating on behalf of", key = "edc.participant.id", defaultValue = "anonymous")
43+
public String participantId;
4244

45+
@Inject
46+
private RetryPolicy<Object> retryPolicy;
4347
@Inject
4448
private PipelineService pipelineService;
45-
4649
@Inject
4750
private BlobStoreApi blobStoreApi;
48-
4951
@Inject
5052
private DataTransferExecutorServiceContainer executorContainer;
51-
5253
@Inject
5354
private Vault vault;
54-
5555
@Inject
5656
private TypeManager typeManager;
5757

@@ -66,7 +66,7 @@ public void initialize(ServiceExtensionContext context) {
6666

6767
var metadataProvider = new BlobMetadataProviderImpl(monitor);
6868
context.registerService(BlobMetadataProvider.class, metadataProvider);
69-
metadataProvider.registerDecorator(new CommonBlobMetadataDecorator(typeManager, context));
69+
metadataProvider.registerDecorator(new CommonBlobMetadataDecorator(participantId, context.getComponentId()));
7070

7171
var sourceFactory = new AzureStorageDataSourceFactory(blobStoreApi, retryPolicy, monitor, vault);
7272
pipelineService.registerFactory(sourceFactory);

extensions/data-plane/data-plane-azure-storage/src/main/java/org/eclipse/edc/connector/dataplane/azure/storage/metadata/CommonBlobMetadataDecorator.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
import org.eclipse.edc.azure.blob.AzureBlobStoreSchema;
1818
import org.eclipse.edc.connector.dataplane.spi.pipeline.DataSource;
19-
import org.eclipse.edc.spi.system.ServiceExtensionContext;
20-
import org.eclipse.edc.spi.types.TypeManager;
2119
import org.eclipse.edc.spi.types.domain.transfer.DataFlowStartMessage;
2220
import org.eclipse.edc.util.string.StringUtils;
2321

@@ -28,22 +26,21 @@ public class CommonBlobMetadataDecorator implements BlobMetadataDecorator {
2826
public static final String PROCESS_ID = "processId";
2927
public static final String CONNECTOR_ID = "connectorId";
3028
public static final String PARTICIPANT_ID = "participantId";
31-
private final TypeManager typeManager;
32-
private final ServiceExtensionContext context;
29+
private final String componentId;
30+
private final String participantId;
3331

34-
public CommonBlobMetadataDecorator(TypeManager typeManager, ServiceExtensionContext context) {
35-
this.typeManager = typeManager;
36-
this.context = context;
32+
public CommonBlobMetadataDecorator(String participantId, String componentId) {
33+
this.participantId = participantId;
34+
this.componentId = componentId;
3735
}
3836

3937
@Override
4038
public BlobMetadata.Builder decorate(DataFlowStartMessage request, DataSource.Part part, BlobMetadata.Builder builder) {
41-
4239
builder.put(ORIGINAL_NAME, part.name())
4340
.put(REQUEST_ID, request.getId())
4441
.put(PROCESS_ID, request.getProcessId())
45-
.put(CONNECTOR_ID, context.getComponentId())
46-
.put(PARTICIPANT_ID, context.getParticipantId());
42+
.put(CONNECTOR_ID, componentId)
43+
.put(PARTICIPANT_ID, participantId);
4744

4845
var dataAddress = request.getDestinationDataAddress();
4946
var correlationId = dataAddress.getStringProperty(AzureBlobStoreSchema.CORRELATION_ID);

extensions/data-plane/data-plane-azure-storage/src/test/java/org/eclipse/edc/connector/dataplane/azure/storage/AzureDataPlaneCopyIntegrationTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.eclipse.edc.json.JacksonTypeManager;
3535
import org.eclipse.edc.spi.monitor.Monitor;
3636
import org.eclipse.edc.spi.security.Vault;
37-
import org.eclipse.edc.spi.system.ServiceExtensionContext;
3837
import org.eclipse.edc.spi.types.TypeManager;
3938
import org.eclipse.edc.spi.types.domain.DataAddress;
4039
import org.eclipse.edc.spi.types.domain.transfer.DataFlowStartMessage;
@@ -71,7 +70,6 @@ class AzureDataPlaneCopyIntegrationTest extends AbstractAzureBlobTest {
7170
private final RetryPolicy<Object> policy = RetryPolicy.builder().withMaxRetries(1).build();
7271
private final String sinkContainerName = createContainerName();
7372
private final String blobName = createBlobName();
74-
private final ServiceExtensionContext context = mock();
7573
private final ExecutorService executor = Executors.newFixedThreadPool(2);
7674
private final Monitor monitor = mock();
7775
private final Vault vault = mock();
@@ -156,9 +154,7 @@ public BlobAdapter getBlobAdapter(String accountName, String containerName, Stri
156154
};
157155

158156
var metadataProvider = new BlobMetadataProviderImpl(monitor);
159-
metadataProvider.registerDecorator(new CommonBlobMetadataDecorator(typeManager, context));
160-
when(context.getComponentId()).thenReturn("connector-id");
161-
when(context.getParticipantId()).thenReturn("participant-id");
157+
metadataProvider.registerDecorator(new CommonBlobMetadataDecorator("participant-id", "connector-id"));
162158
var dataSinkFactory = new AzureStorageDataSinkFactory(account2ApiPatched, executor, partitionSize, monitor, vault, typeManager, metadataProvider);
163159
var dataSink = dataSinkFactory.createSink(request);
164160

extensions/data-plane/data-plane-azure-storage/src/test/java/org/eclipse/edc/connector/dataplane/azure/storage/metadata/CommonBlobMetadataDecoratorTest.java

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,15 @@
1616

1717
import org.eclipse.edc.azure.blob.AzureBlobStoreSchema;
1818
import org.eclipse.edc.connector.dataplane.spi.pipeline.DataSource;
19-
import org.eclipse.edc.spi.system.ServiceExtensionContext;
20-
import org.eclipse.edc.spi.types.TypeManager;
2119
import org.eclipse.edc.spi.types.domain.DataAddress;
2220
import org.eclipse.edc.spi.types.domain.transfer.DataFlowStartMessage;
2321
import org.eclipse.edc.util.string.StringUtils;
24-
import org.junit.jupiter.api.Test;
2522
import org.junit.jupiter.params.ParameterizedTest;
2623
import org.junit.jupiter.params.provider.CsvSource;
2724

2825
import java.io.InputStream;
2926

3027
import static org.assertj.core.api.Assertions.assertThat;
31-
import static org.assertj.core.api.Assertions.assertThatThrownBy;
3228
import static org.eclipse.edc.azure.blob.AzureBlobStoreSchema.CORRELATION_ID;
3329
import static org.eclipse.edc.azure.blob.testfixtures.AzureStorageTestFixtures.createRequest;
3430
import static org.eclipse.edc.connector.dataplane.azure.storage.metadata.CommonBlobMetadataDecorator.CONNECTOR_ID;
@@ -46,14 +42,11 @@ public class CommonBlobMetadataDecoratorTest {
4642
private static final String TEST_ORIGINAL_NAME = "original-name";
4743
private static final String TEST_CONNECTOR_ID = "some-connector-id";
4844
private static final String TEST_PARTICIPANT_ID = "some-participant-id";
49-
private final TypeManager typeManager = mock();
5045
private final DataFlowStartMessage.Builder requestBuilder = createRequest(AzureBlobStoreSchema.TYPE);
5146

5247
@ParameterizedTest
5348
@CsvSource(value = { "correlation-id", "''", "null" }, nullValues = { "null" })
5449
void decorate_succeeds(String correlationId) {
55-
56-
var context = mock(ServiceExtensionContext.class);
5750
var samplePart = new DataSource.Part() { // close is no-op
5851
@Override
5952
public String name() {
@@ -66,10 +59,7 @@ public InputStream openStream() {
6659
}
6760
};
6861

69-
when(context.getComponentId()).thenReturn(TEST_CONNECTOR_ID);
70-
when(context.getParticipantId()).thenReturn(TEST_PARTICIPANT_ID);
71-
72-
var decorator = new CommonBlobMetadataDecorator(typeManager, context);
62+
var decorator = new CommonBlobMetadataDecorator(TEST_PARTICIPANT_ID, TEST_CONNECTOR_ID);
7363
var builder = mock(BlobMetadata.Builder.class);
7464
when(builder.put(anyString(), anyString())).thenReturn(builder);
7565

@@ -100,27 +90,4 @@ public InputStream openStream() {
10090

10191
assertThat(result).isInstanceOf(BlobMetadata.Builder.class);
10292
}
103-
104-
@Test
105-
void decorate_whenUsingIllegalCharacters_fails() {
106-
107-
var context = mock(ServiceExtensionContext.class);
108-
var samplePart = new DataSource.Part() { // close is no-op
109-
@Override
110-
public String name() {
111-
return "ä§";
112-
}
113-
114-
@Override
115-
public InputStream openStream() {
116-
return null;
117-
}
118-
};
119-
var decorator = new CommonBlobMetadataDecorator(typeManager, context);
120-
var builder = mock(BlobMetadata.Builder.class);
121-
when(builder.put(anyString(), anyString())).thenReturn(builder);
122-
var request = requestBuilder.build();
123-
assertThatThrownBy(() -> decorator.decorate(request, samplePart, builder))
124-
.isInstanceOf(NullPointerException.class);
125-
}
12693
}

extensions/data-plane/data-plane-azure-storage/src/test/java/org/eclipse/edc/connector/dataplane/azure/storage/pipeline/AzureDataSourceToDataSinkTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ void transfer_success() {
109109
)).thenReturn(fakeCompletionMarker);
110110

111111
when(context.getComponentId()).thenReturn("connectorId");
112-
when(context.getParticipantId()).thenReturn("participantId");
113112

114113
var metadataProvider = new BlobMetadataProviderImpl(monitor);
115114

@@ -171,7 +170,6 @@ void transfer_WhenSourceFails_fails() throws Exception {
171170
)).thenReturn(fakeSink);
172171

173172
when(context.getComponentId()).thenReturn("connectorId");
174-
when(context.getParticipantId()).thenReturn("participantId");
175173

176174
var metadataProvider = new BlobMetadataProviderImpl(monitor);
177175

@@ -227,7 +225,6 @@ void transfer_whenSinkFails_fails() throws Exception {
227225
.thenReturn(blobAdapter);
228226

229227
when(context.getComponentId()).thenReturn("connectorId");
230-
when(context.getParticipantId()).thenReturn("participantId");
231228

232229
var metadataProvider = new BlobMetadataProviderImpl(monitor);
233230

extensions/data-plane/data-plane-azure-storage/src/test/java/org/eclipse/edc/connector/dataplane/azure/storage/pipeline/AzureStorageDataSinkTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ void setUp() {
9393
.thenReturn(destination);
9494

9595
when(context.getComponentId()).thenReturn("connectorId");
96-
when(context.getParticipantId()).thenReturn("participantId");
9796
when(destinationBlobName.resolve(blobName, 1)).thenReturn(blobName);
9897
}
9998

gradle/libs.versions.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ edc-spi-transfer = { module = "org.eclipse.edc:transfer-spi", version.ref = "edc
4545
edc-spi-transaction-datasource = { module = "org.eclipse.edc:transaction-datasource-spi", version.ref = "edc" }
4646
edc-spi-dataplane = { module = "org.eclipse.edc:data-plane-spi", version.ref = "edc" }
4747
edc-spi-asset = { module = "org.eclipse.edc:asset-spi", version.ref = "edc" }
48+
edc-spi-participant-context-single = { module = "org.eclipse.edc:participant-context-single-spi", version.ref = "edc" }
4849
edc-transaction-local = { module = "org.eclipse.edc:transaction-local", version.ref = "edc" }
4950
edc-transfer-data-plane-signaling = { module = "org.eclipse.edc:transfer-data-plane-signaling", version.ref = "edc" }
5051
edc-management-api-test-fixtures = { module = "org.eclipse.edc:management-api-test-fixtures", version.ref = "edc" }
@@ -86,4 +87,4 @@ azure-storageblob = { group = "com.azure", name = "azure-storage-blob", version
8687

8788
[plugins]
8889
edc-build = { id = "org.eclipse.edc.edc-build", version = "1.0.0" }
89-
shadow = { id = "com.gradleup.shadow", version = "8.3.6" }
90+
shadow = { id = "com.gradleup.shadow", version = "9.2.2" }

gradle/wrapper/gradle-wrapper.jar

121 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)