Skip to content

Commit

Permalink
chore(deps): update EDC to 0.1.0 (#433)
Browse files Browse the repository at this point in the history
* chore(deps): update EDC to 0.1.0

* chore(deps): bump curl in alpine images
  • Loading branch information
wolf4ood authored May 31, 2023
1 parent 1a554e6 commit c4d49f6
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

HEALTHCHECK NONE

RUN apk update && apk add curl=8.1.1-r1 --no-cache
RUN apk update && apk add curl=8.1.2-r0 --no-cache
RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar

FROM eclipse-temurin:17.0.6_10-jre-alpine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

HEALTHCHECK NONE

RUN apk update && apk add curl=8.1.1-r1 --no-cache
RUN apk update && apk add curl=8.1.2-r0 --no-cache
RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar

FROM eclipse-temurin:17.0.6_10-jre-alpine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

HEALTHCHECK NONE

RUN apk update && apk add curl=8.1.1-r1 --no-cache
RUN apk update && apk add curl=8.1.2-r0 --no-cache
RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar

FROM eclipse-temurin:17.0.6_10-jre-alpine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

HEALTHCHECK NONE

RUN apk update && apk add curl=8.1.1-r1 --no-cache
RUN apk update && apk add curl=8.1.2-r0 --no-cache
RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar

FROM eclipse-temurin:17.0.6_10-jre-alpine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV OTEL_AGENT_LOCATION "https://github.com/open-telemetry/opentelemetry-java-in

HEALTHCHECK NONE

RUN apk update && apk add curl=8.1.1-r1 --no-cache
RUN apk update && apk add curl=8.1.2-r0 --no-cache
RUN curl -L --proto "=https" -sSf ${OTEL_AGENT_LOCATION} --output /tmp/opentelemetry-javaagent.jar

FROM eclipse-temurin:17.0.6_10-jre-alpine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import org.eclipse.edc.api.model.CallbackAddressDto;
import org.eclipse.edc.connector.api.management.contractnegotiation.model.ContractOfferDescription;
import org.eclipse.edc.spi.types.domain.callback.CallbackAddress;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -46,7 +46,7 @@ public class NegotiateEdrRequestDto {

@NotNull(message = "offer cannot be null")
private ContractOfferDescription offer;
private List<CallbackAddressDto> callbackAddresses = new ArrayList<>();
private List<CallbackAddress> callbackAddresses = new ArrayList<>();

private NegotiateEdrRequestDto() {

Expand All @@ -68,7 +68,7 @@ public String getProviderId() {
return providerId;
}

public List<CallbackAddressDto> getCallbackAddresses() {
public List<CallbackAddress> getCallbackAddresses() {
return callbackAddresses;
}

Expand Down Expand Up @@ -112,7 +112,7 @@ public Builder providerId(String providerId) {
return this;
}

public Builder callbackAddresses(List<CallbackAddressDto> callbackAddresses) {
public Builder callbackAddresses(List<CallbackAddress> callbackAddresses) {
dto.callbackAddresses = callbackAddresses;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

import jakarta.json.JsonObject;
import jakarta.json.JsonValue;
import org.eclipse.edc.api.model.CallbackAddressDto;
import org.eclipse.edc.connector.api.management.contractnegotiation.model.ContractOfferDescription;
import org.eclipse.edc.jsonld.spi.transformer.AbstractJsonLdTransformer;
import org.eclipse.edc.spi.types.domain.callback.CallbackAddress;
import org.eclipse.edc.transform.spi.TransformerContext;
import org.eclipse.tractusx.edc.api.cp.adapter.dto.NegotiateEdrRequestDto;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -64,8 +64,8 @@ private void setProperties(String key, JsonValue value, NegotiateEdrRequestDto.B
transformString(value, builder::providerId, context);
break;
case EDR_REQUEST_DTO_CALLBACK_ADDRESSES:
var addresses = new ArrayList<CallbackAddressDto>();
transformArrayOrObject(value, CallbackAddressDto.class, addresses::add, context);
var addresses = new ArrayList<CallbackAddress>();
transformArrayOrObject(value, CallbackAddress.class, addresses::add, context);
builder.callbackAddresses(addresses);
break;
case EDR_REQUEST_DTO_OFFER:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@

import org.eclipse.edc.api.transformer.DtoTransformer;
import org.eclipse.edc.connector.contract.spi.types.offer.ContractOffer;
import org.eclipse.edc.spi.types.domain.callback.CallbackAddress;
import org.eclipse.edc.transform.spi.TransformerContext;
import org.eclipse.tractusx.edc.api.cp.adapter.dto.NegotiateEdrRequestDto;
import org.eclipse.tractusx.edc.spi.cp.adapter.model.NegotiateEdrRequest;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.stream.Collectors;

public class NegotiateEdrRequestDtoToNegotiatedEdrRequestTransformer implements DtoTransformer<NegotiateEdrRequestDto, NegotiateEdrRequest> {

@Override
public Class<NegotiateEdrRequestDto> getInputType() {
return NegotiateEdrRequestDto.class;
Expand All @@ -39,8 +36,6 @@ public Class<NegotiateEdrRequest> getOutputType() {

@Override
public @Nullable NegotiateEdrRequest transform(@NotNull NegotiateEdrRequestDto object, @NotNull TransformerContext context) {
var callbacks = object.getCallbackAddresses().stream().map(c -> context.transform(c, CallbackAddress.class)).collect(Collectors.toList());

var contractOffer = ContractOffer.Builder.newInstance()
.id(object.getOffer().getOfferId())
.assetId(object.getOffer().getAssetId())
Expand All @@ -53,7 +48,7 @@ public Class<NegotiateEdrRequest> getOutputType() {
.connectorAddress(object.getConnectorAddress())
.protocol(object.getProtocol())
.offer(contractOffer)
.callbackAddresses(callbacks)
.callbackAddresses(object.getCallbackAddresses())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import jakarta.json.JsonArrayBuilder;
import jakarta.json.JsonObject;
import jakarta.json.JsonValue;
import org.eclipse.edc.api.model.CallbackAddressDto;
import org.eclipse.edc.connector.api.management.contractnegotiation.model.ContractOfferDescription;
import org.eclipse.edc.connector.api.management.contractnegotiation.model.NegotiationInitiateRequestDto;
import org.eclipse.edc.jsonld.TitaniumJsonLd;
Expand Down Expand Up @@ -93,7 +92,7 @@ void transform() {
.events(Set.of("foo", "bar"))
.transactional(true)
.build());
when(context.transform(any(CallbackAddress.class), eq(CallbackAddressDto.class))).thenReturn(CallbackAddressDto.Builder.newInstance()
when(context.transform(any(CallbackAddress.class), eq(CallbackAddress.class))).thenReturn(CallbackAddress.Builder.newInstance()
.uri("http://test.local")
.events(Set.of("foo", "bar"))
.transactional(true)
Expand Down Expand Up @@ -121,7 +120,7 @@ void transform_reportErrors() {
.build();

var dto = transformer.transform(jsonLd.expand(jsonObject).getContent(), context);

assertThat(dto).isNotNull();
verify(context, times(1)).reportProblem(anyString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

package org.eclipse.tractusx.edc.api.cp.adapter.transform;

import org.eclipse.edc.api.model.CallbackAddressDto;
import org.eclipse.edc.spi.types.domain.callback.CallbackAddress;
import org.eclipse.edc.transform.spi.TransformerContext;
import org.eclipse.tractusx.edc.api.cp.adapter.dto.NegotiateEdrRequestDto;
import org.junit.jupiter.api.Test;
Expand All @@ -39,7 +39,7 @@ void inputOutputType() {

@Test
void verify_transform() {
var callback = CallbackAddressDto.Builder.newInstance()
var callback = CallbackAddress.Builder.newInstance()
.uri("local://test")
.build();
var dto = NegotiateEdrRequestDto.Builder.newInstance()
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.1-SNAPSHOT
# configure the build:
annotationProcessorVersion=0.1.0-20230529-SNAPSHOT
edcGradlePluginsVersion=0.1.0-20230529-SNAPSHOT
metaModelVersion=0.1.0-20230529-SNAPSHOT
annotationProcessorVersion=0.1.0
edcGradlePluginsVersion=0.1.0
metaModelVersion=0.1.0
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-20230529-SNAPSHOT"
edc = "0.1.0"
postgres = "42.6.0"
awaitility = "4.2.0"
nimbus = "9.31"
Expand Down
13 changes: 2 additions & 11 deletions resources/openapi/yaml/control-plane-adapter-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,10 @@ components:
type:
type: string
example: null
CallbackAddressDto:
CallbackAddress:
type: object
example: null
properties:
'@context':
type: object
example: null
'@type':
type: string
example: null
authCodeId:
type: string
example: null
Expand All @@ -179,9 +173,6 @@ components:
uri:
type: string
example: null
required:
- events
- uri
Constraint:
type: object
discriminator:
Expand Down Expand Up @@ -328,7 +319,7 @@ components:
type: array
example: null
items:
$ref: '#/components/schemas/CallbackAddressDto'
$ref: '#/components/schemas/CallbackAddress'
connectorAddress:
type: string
example: null
Expand Down

0 comments on commit c4d49f6

Please sign in to comment.