Skip to content

Commit

Permalink
feat: upgrade to 0.1.1-SNAPSHOT, fix resulting compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Jun 19, 2023
1 parent bc05aa8 commit 1d7fce2
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deployment-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
helm install tx-prod charts/tractusx-connector \
-f edc-tests/deployment/src/main/resources/helm/tractusx-connector-test.yaml \
--dependency-update \
--wait-for-jobs --timeout=120s
--wait-for-jobs --timeout=120s
# wait for the pod to become ready
kubectl rollout status deployment tx-prod-controlplane
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on:
branches:
- main
- releases
- previews/*
tags:
- '[0-9]+.[0-9]+.[0-9]+'
release:
Expand Down
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,10 @@ nexusPublishing {
maxRetries.set(120)
delayBetween.set(Duration.ofSeconds(10))
}
}

configurations.all {
// Check for updates every 5 mins
// TODO: REMOVE THIS BEFORE MERGING TO main!!!!
resolutionStrategy.cacheChangingModulesFor(5, TimeUnit.MINUTES)
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void getEdr_shouldReturnDataAddress_whenFound() {
var transferProcessId = "id";
var edr = EndpointDataReference.Builder.newInstance().endpoint("test").id(transferProcessId).build();
var response = Json.createObjectBuilder()
.add(DataAddress.TYPE, EndpointDataReference.EDR_SIMPLE_TYPE)
.add(DataAddress.EDC_DATA_ADDRESS_TYPE, EndpointDataReference.EDR_SIMPLE_TYPE)
.add(EndpointDataReference.ENDPOINT, edr.getEndpoint())
.add(EndpointDataReference.ID, edr.getId())
.build();
Expand Down Expand Up @@ -164,7 +164,7 @@ void queryEdrs_shouldReturnCachedEntries_whenAssetIdIsProvided() {
.add(EDR_ENTRY_TRANSFER_PROCESS_ID, entry.getTransferProcessId())
.add(EDR_ENTRY_AGREEMENT_ID, entry.getAgreementId())
.build();

when(adapterTransferProcessService.findByAssetAndAgreement(assetId, null)).thenReturn(ServiceResult.success(List.of(entry)));
when(transformerRegistry.transform(any(EndpointDataReferenceEntry.class), eq(JsonObject.class))).thenReturn(Result.success(response));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ public TransferProcessLocalCallback(EndpointDataReferenceCache edrCache, Transfe

@Override
public <T extends Event> Result<Void> invoke(CallbackEventRemoteMessage<T> message) {
if (message.getEventEnvelope().getPayload() instanceof TransferProcessStarted) {
var transferProcessStarted = (TransferProcessStarted) message.getEventEnvelope().getPayload();
if (message.getEventEnvelope().getPayload() instanceof TransferProcessStarted transferProcessStarted) {
if (transferProcessStarted.getDataAddress() != null) {
return EndpointDataAddressConstants.to(transferProcessStarted.getDataAddress())
.compose(this::storeEdr)
Expand All @@ -57,8 +56,7 @@ public <T extends Event> Result<Void> invoke(CallbackEventRemoteMessage<T> messa
private Result<Void> storeEdr(EndpointDataReference edr) {
return transactionContext.execute(() -> {
// TODO upstream api for getting the TP with the DataRequest#id
var transferProcessId = transferProcessStore.processIdForDataRequestId(edr.getId());
var transferProcess = transferProcessStore.findById(transferProcessId);
var transferProcess = transferProcessStore.findForCorrelationId(edr.getId());
if (transferProcess != null) {
var cacheEntry = EndpointDataReferenceEntry.Builder.newInstance()
.transferProcessId(transferProcess.getId())
Expand All @@ -69,7 +67,7 @@ private Result<Void> storeEdr(EndpointDataReference edr) {
edrCache.save(cacheEntry, edr);
return Result.success();
} else {
return Result.failure(format("Failed to find a transfer process with ID %s", transferProcessId));
return Result.failure(format("Failed to find a transfer process with correlation ID %s", edr.getId()));
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ void invoke_shouldStoreTheEdrInCache_whenDataAddressIsPresent() {

var edr = getEdr();

when(transferProcessStore.processIdForDataRequestId(edr.getId())).thenReturn(transferProcessId);

var dataRequest = DataRequest.Builder.newInstance().id(edr.getId())
.destinationType("HttpProxy")
.assetId(assetId)
Expand All @@ -92,6 +90,8 @@ void invoke_shouldStoreTheEdrInCache_whenDataAddressIsPresent() {
.dataRequest(dataRequest)
.build();

when(transferProcessStore.findForCorrelationId(edr.getId())).thenReturn(transferProcess);

when(transferProcessStore.findById(transferProcessId)).thenReturn(transferProcess);


Expand Down Expand Up @@ -130,7 +130,7 @@ void invoke_shouldNotFail_whenTransferProcessNotFound() {

var edr = getEdr();

when(transferProcessStore.processIdForDataRequestId(edr.getId())).thenReturn(transferProcessId);
when(transferProcessStore.findForCorrelationId(edr.getId())).thenReturn(null);

when(transferProcessStore.findById(transferProcessId)).thenReturn(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ void shouldPutContractIdAsHeaderInDataAddress(
var transferMessage = TransferRequestMessage.Builder.newInstance()
.id("id")
.protocol("protocol")
.assetId("assetId")
.contractId("1:assetId:aContractId")
.dataDestination(DataAddress.Builder.newInstance().type("HttpProxy").build())
.callbackAddress("callbackAddress")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public Builder sftpUser(SftpUser user) {
this.address.getProperties().put(USER_PASSWORD, user.getPassword());
if (user.getKeyPair() != null) {
this.address.getProperties().put(USER_PRIVATE_KEY, Base64.getEncoder().encodeToString(user.getKeyPair().getPrivate().getEncoded()));
this.address.getProperties().put(KEY_NAME, user.getName());
this.address.getProperties().put(EDC_DATA_ADDRESS_KEY_NAME, user.getName());
}
return this;
}
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
group=org.eclipse.tractusx.edc
version=0.4.2-SNAPSHOT
# configure the build:
annotationProcessorVersion=0.1.0
edcGradlePluginsVersion=0.1.0
metaModelVersion=0.1.0
annotationProcessorVersion=0.1.1-SNAPSHOT
edcGradlePluginsVersion=0.1.1-SNAPSHOT
metaModelVersion=0.1.1-SNAPSHOT
txScmConnection=scm:git:[email protected]:eclipse-tractusx/tractusx-edc.git
txWebsiteUrl=https://github.com/eclipse-tractusx/tractusx-edc.git
txScmUrl=https://github.com/eclipse-tractusx/tractusx-edc.git
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
format.version = "1.1"

[versions]
edc = "0.1.0"
edc = "0.1.1-SNAPSHOT"
postgres = "42.6.0"
awaitility = "4.2.0"
nimbus = "9.31"
Expand Down

0 comments on commit 1d7fce2

Please sign in to comment.