Search in sources :

Example 1 with AssetLoader

use of org.eclipse.dataspaceconnector.dataloading.AssetLoader in project DataSpaceConnector by eclipse-dataspaceconnector.

the class HttpProvisionerExtensionEndToEndTest method setup.

@BeforeEach
void setup(EdcExtension extension) {
    extension.setConfiguration(Map.of("web.http.data.port", String.valueOf(dataPort), "web.http.data.path", "/api/v1/data"));
    delegate = mock(Interceptor.class);
    var httpClient = testOkHttpClient().newBuilder().addInterceptor(delegate).build();
    extension.registerServiceMock(TransferWaitStrategy.class, () -> 1);
    extension.registerSystemExtension(ServiceExtension.class, new HttpProvisionerExtension(httpClient));
    extension.registerSystemExtension(ServiceExtension.class, new DummyCallbackUrlExtension());
    extension.setConfiguration(PROVISIONER_CONFIG);
    extension.registerSystemExtension(ServiceExtension.class, new ServiceExtension() {

        @Inject
        private AssetLoader // needed for on-demand dependency resolution
        loader;
    });
}
Also used : Inject(org.eclipse.dataspaceconnector.spi.system.Inject) ServiceExtension(org.eclipse.dataspaceconnector.spi.system.ServiceExtension) AssetLoader(org.eclipse.dataspaceconnector.dataloading.AssetLoader) HttpProvisionerExtension(org.eclipse.dataspaceconnector.transfer.provision.http.HttpProvisionerExtension) Interceptor(okhttp3.Interceptor) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with AssetLoader

use of org.eclipse.dataspaceconnector.dataloading.AssetLoader in project DataSpaceConnector by eclipse-dataspaceconnector.

the class CloudTransferExtension method registerDataEntries.

private void registerDataEntries(ServiceExtensionContext context) {
    AssetLoader assetIndex = context.getService(AssetLoader.class);
    DataAddress dataAddress = DataAddress.Builder.newInstance().property("type", "AzureStorage").property("container", "src-container").property("blobname", "test-document.txt").build();
    String assetId = "test-document";
    Asset asset = Asset.Builder.newInstance().id(assetId).build();
    assetIndex.accept(asset, dataAddress);
}
Also used : AssetLoader(org.eclipse.dataspaceconnector.dataloading.AssetLoader) Asset(org.eclipse.dataspaceconnector.spi.types.domain.asset.Asset) DataAddress(org.eclipse.dataspaceconnector.spi.types.domain.DataAddress)

Aggregations

AssetLoader (org.eclipse.dataspaceconnector.dataloading.AssetLoader)2 Interceptor (okhttp3.Interceptor)1 Inject (org.eclipse.dataspaceconnector.spi.system.Inject)1 ServiceExtension (org.eclipse.dataspaceconnector.spi.system.ServiceExtension)1 DataAddress (org.eclipse.dataspaceconnector.spi.types.domain.DataAddress)1 Asset (org.eclipse.dataspaceconnector.spi.types.domain.asset.Asset)1 HttpProvisionerExtension (org.eclipse.dataspaceconnector.transfer.provision.http.HttpProvisionerExtension)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1