Skip to content

Commit ba306b4

Browse files
authored
Merge pull request #17 from eclipse-edc/fix-ci
fix: test assertion
2 parents dab1548 + 62a504e commit ba306b4

File tree

7 files changed

+9
-15
lines changed

7 files changed

+9
-15
lines changed

extensions/control-plane/store/contract-negotiation-store-cosmos/src/test/java/org/eclipse/edc/connector/store/azure/cosmos/contractnegotiation/CosmosContractNegotiationStoreIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ void findAll_verifySortingInvalidSortField() {
466466
@Test
467467
void queryAgreements_noQuerySpec() {
468468
IntStream.range(0, 10).forEach(i -> {
469-
var contractAgreement = createContractBuilder().id(ContractId.createContractId(UUID.randomUUID().toString(), "test-asset-id")).build();
469+
var contractAgreement = createContractBuilder().id(ContractId.create(UUID.randomUUID().toString(), "test-asset-id").toString()).build();
470470
var negotiation = createNegotiationBuilder(UUID.randomUUID().toString()).contractAgreement(contractAgreement).build();
471471
store.save(negotiation);
472472
});
@@ -479,7 +479,7 @@ void queryAgreements_noQuerySpec() {
479479
@Test
480480
void queryAgreements_verifyPaging() {
481481
IntStream.range(0, 10).forEach(i -> {
482-
var contractAgreement = createContractBuilder().id(ContractId.createContractId(UUID.randomUUID().toString(), "test-asset-id")).build();
482+
var contractAgreement = createContractBuilder().id(ContractId.create(UUID.randomUUID().toString(), "test-asset-id").toString()).build();
483483
var negotiation = createNegotiationBuilder(UUID.randomUUID().toString()).contractAgreement(contractAgreement).build();
484484
store.save(negotiation);
485485
});

system-tests/azure-data-factory-tests/src/test/java/org/eclipse/edc/test/system/local/AzureDataFactoryTransferIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void transferBlob_success() {
173173

174174
var blobServiceClient = TestFunctions.getBlobServiceClient(CONSUMER_STORAGE_ACCOUNT_NAME, account2Key, TestFunctions.getBlobServiceTestEndpoint(format("https://%s.blob.core.windows.net", CONSUMER_STORAGE_ACCOUNT_NAME)));
175175

176-
var runner = new TransferTestRunner(new BlobTransferConfiguration(CONSUMER_CONNECTOR_MANAGEMENT_URL, PROVIDER_PROTOCOL_URL, blobServiceClient, 360));
176+
var runner = new TransferTestRunner(new BlobTransferConfiguration(CONSUMER_CONNECTOR_MANAGEMENT_URL, PROVIDER_PROTOCOL_URL, blobServiceClient));
177177

178178
runner.executeTransfer();
179179
}

system-tests/azure-tests/src/test/java/org/eclipse/edc/test/system/local/BlobTransferIntegrationTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,9 @@ void transferBlob_success() {
148148

149149
var blobServiceClient = TestFunctions.getBlobServiceClient(account2Name, account2Key, TestFunctions.getBlobServiceTestEndpoint(account2Name));
150150

151-
var runner = new TransferTestRunner(new BlobTransferConfiguration(CONSUMER_CONNECTOR_MANAGEMENT_URL, PROVIDER_PROTOCOL_URL, blobServiceClient, 30));
151+
var runner = new TransferTestRunner(new BlobTransferConfiguration(CONSUMER_CONNECTOR_MANAGEMENT_URL, PROVIDER_PROTOCOL_URL, blobServiceClient));
152152

153153
runner.executeTransfer();
154-
155154
}
156155

157-
158156
}

system-tests/azure-tests/src/testFixtures/java/org/eclipse/edc/test/system/local/BlobTransferConfiguration.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ public class BlobTransferConfiguration implements TransferConfiguration {
3232
private final String consumerManagementUrl;
3333
private final String providerIdsUrl;
3434
private final BlobServiceClient blobServiceClient;
35-
private final int maxSeconds;
3635

37-
public BlobTransferConfiguration(String consumerManagementUrl, String providerIdsUrl, BlobServiceClient blobServiceClient, int maxSeconds) {
36+
public BlobTransferConfiguration(String consumerManagementUrl, String providerIdsUrl, BlobServiceClient blobServiceClient) {
3837
this.consumerManagementUrl = consumerManagementUrl;
3938
this.providerIdsUrl = providerIdsUrl;
4039
this.blobServiceClient = blobServiceClient;
41-
this.maxSeconds = maxSeconds;
4240
}
4341

4442
@Override

system-tests/e2e-transfer-test/runner/src/test/java/org/eclipse/edc/test/e2e/EndToEndTransferCosmosDbTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.eclipse.edc.connector.contract.spi.ContractId;
2424
import org.eclipse.edc.junit.extensions.EdcRuntimeExtension;
2525
import org.eclipse.edc.policy.model.Operator;
26+
import org.eclipse.edc.spi.EdcException;
2627
import org.jetbrains.annotations.NotNull;
2728
import org.junit.jupiter.api.AfterAll;
2829
import org.junit.jupiter.api.BeforeAll;
@@ -312,7 +313,7 @@ void httpPushDataTransfer_oauth2Provisioning() {
312313

313314
private ContractId getContractId(JsonObject dataset) {
314315
var id = dataset.getJsonArray(ODRL_POLICY_ATTRIBUTE).get(0).asJsonObject().getString(ID);
315-
return ContractId.parse(id);
316+
return ContractId.parseId(id).orElseThrow(f -> new EdcException(f.getFailureDetail()));
316317
}
317318

318319
private JsonObject httpDataAddress(String baseUrl) {

system-tests/e2e-transfer-test/runner/src/test/java/org/eclipse/edc/test/e2e/Participant.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ public String getName() {
469469

470470
private ContractId getContractId(JsonObject dataset) {
471471
var id = dataset.getJsonArray(ODRL_POLICY_ATTRIBUTE).get(0).asJsonObject().getString(ID);
472-
return ContractId.parse(id);
472+
return ContractId.parseId(id).orElseThrow(f -> new RuntimeException(f.getFailureDetail()));
473473
}
474474

475475
private String getContractNegotiationField(String negotiationId, String fieldName) {

system-tests/tests/src/testFixtures/java/org/eclipse/edc/test/system/utils/TransferTestClient.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import static org.assertj.core.api.Assertions.assertThat;
3737
import static org.awaitility.Awaitility.await;
3838
import static org.eclipse.edc.connector.contract.spi.types.negotiation.ContractNegotiationStates.FINALIZED;
39-
import static org.eclipse.edc.connector.transfer.spi.types.TransferProcessStates.STARTED;
4039
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.CONTEXT;
4140
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.ID;
4241
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.TYPE;
@@ -47,7 +46,6 @@
4746
import static org.eclipse.edc.test.system.local.TransferRuntimeConfiguration.CONSUMER_PARTICIPANT_ID;
4847
import static org.eclipse.edc.test.system.utils.Constants.POLL_INTERVAL;
4948
import static org.eclipse.edc.test.system.utils.Constants.TIMEOUT;
50-
import static org.hamcrest.Matchers.is;
5149

5250
/**
5351
* Simple client for testing transfer scenario
@@ -64,7 +62,7 @@ public TransferTestClient(String consumerUrl) {
6462

6563
static ContractId getContractId(JsonObject dataset) {
6664
var id = dataset.getJsonArray(ODRL_POLICY_ATTRIBUTE).get(0).asJsonObject().getString(ID);
67-
return ContractId.parse(id);
65+
return ContractId.parseId(id).orElseThrow(f -> new EdcException(f.getFailureDetail()));
6866
}
6967

7068
public JsonArray getCatalogDatasets(String providerUrl) {
@@ -206,7 +204,6 @@ public Map<String, String> getTransferProcess(String transferProcessId) {
206204
.get("/v2/transferprocesses/{id}", transferProcessId)
207205
.then()
208206
.statusCode(200)
209-
.body("'edc:state'", is(STARTED.name()))
210207
.extract().jsonPath().get("'edc:dataDestination'");
211208
}
212209

0 commit comments

Comments
 (0)