Skip to content

Commit

Permalink
removed obsolete HTTP test
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Apr 3, 2023
1 parent fff4aec commit 8ddae2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
import io.cucumber.java.en.When;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.tractusx.edc.tests.data.Asset;
import org.eclipse.tractusx.edc.tests.data.ContractNegotiation;
import org.eclipse.tractusx.edc.tests.data.DataAddress;
import org.eclipse.tractusx.edc.tests.data.HttpProxySinkDataAddress;
import org.eclipse.tractusx.edc.tests.data.HttpProxySourceDataAddress;
import org.eclipse.tractusx.edc.tests.data.Transfer;
import org.junit.jupiter.api.Assertions;

import java.io.IOException;
Expand Down Expand Up @@ -61,19 +59,17 @@ public void hasAssets(Connector connector, DataTable table) throws Exception {
@When("'{connector}' initiates HttpProxy transfer from '{connector}'")
public void sokratesInitiateHttpProxyTransferProcessFromPlato(
Connector consumer, Connector provider, DataTable dataTable) throws IOException {
final DataManagementAPI api = consumer.getDataManagementAPI();
final String receiverUrl = provider.getEnvironment().getIdsUrl() + "/data";
var api = consumer.getDataManagementAPI();
var receiverUrl = provider.getEnvironment().getIdsUrl() + "/data";

final List<ContractNegotiation> negotiation = api.getNegotiations();
final String agreementId = negotiation.get(0).getAgreementId();
final DataAddress dataAddress = new HttpProxySinkDataAddress();
var negotiation = api.getNegotiations();
var agreementId = negotiation.get(0).getAgreementId();
var dataAddress = new HttpProxySinkDataAddress();

for (var map : dataTable.asMaps()) {
final String assetId = map.get(ASSET_ID);
final String receiverHttpEndpoint = map.get(RECEIVER_HTTP_ENDPOINT);
final Transfer transfer =
api.initiateTransferProcess(
receiverUrl, agreementId, assetId, dataAddress, receiverHttpEndpoint);
var transfer = api.initiateTransferProcess(receiverUrl, agreementId, assetId, dataAddress, receiverHttpEndpoint);

transfer.waitUntilComplete(api);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,6 @@ Feature: HttpProxy Data Transfer
Given 'Plato' has an empty database
Given 'Sokrates' has an empty database

Scenario: Connector transfers data via HttpProxy
Given 'Plato' has a http proxy assets
| id | description | baseUrl |
| asset-1 | http proxy transfer asset | http://localhost:8081/api/check/liveness |
And 'Plato' has the following policies
| id | action |
| policy-1 | USE |
And 'Plato' has the following contract definitions
| id | access policy | contract policy | asset |
| contract-definition-1 | policy-1 | policy-1 | asset-1 |
When 'Sokrates' negotiates the contract successfully with 'Plato'
| contract offer id | asset id | policy id |
| contract-definition-1 | asset-1 | policy-1 |
And 'Sokrates' initiates HttpProxy transfer from 'Plato'
| asset id | receiverHttpEndpoint |
| asset-1 | http://backend:8080 |
Then the backend application of 'Sokrates' has received data

Scenario: Connector transfers data via HttpProxy, data on provider side requires oauth2 authentication
Given 'Plato' has a http proxy assets
| id | description | baseUrl | oauth2 token url | oauth2 client id | oauth2 client secret | oauth2 scope |
Expand Down

0 comments on commit 8ddae2d

Please sign in to comment.