Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Refactor dsp messages validations into libs #4547

Merged
merged 5 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data-protocols/dsp/dsp-catalog/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ dependencies {
api(project(":data-protocols:dsp:dsp-catalog:dsp-catalog-http-api"))
api(project(":data-protocols:dsp:dsp-catalog:dsp-catalog-http-dispatcher"))
api(project(":data-protocols:dsp:dsp-catalog:dsp-catalog-transform"))
api(project(":data-protocols:dsp:dsp-catalog:lib:dsp-catalog-validation-lib"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ dependencies {
api(project(":data-protocols:dsp:dsp-http-spi"))
api(project(":spi:common:core-spi"))
api(project(":spi:common:web-spi"))
api(project(":spi:common:json-ld-spi"))

api(project(":spi:control-plane:control-plane-spi"))

implementation(project(":core:common:lib:validator-lib"))
implementation(project(":data-protocols:dsp:dsp-catalog:lib:dsp-catalog-validation-lib"))

implementation(libs.jakarta.rsApi)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.eclipse.edc.protocol.dsp.catalog.http.api.controller.DspCatalogApiController20241;
import org.eclipse.edc.protocol.dsp.catalog.http.api.decorator.Base64continuationTokenSerDes;
import org.eclipse.edc.protocol.dsp.catalog.http.api.decorator.ContinuationTokenManagerImpl;
import org.eclipse.edc.protocol.dsp.catalog.http.api.validation.CatalogRequestMessageValidator;
import org.eclipse.edc.protocol.dsp.catalog.validation.CatalogRequestMessageValidator;
import org.eclipse.edc.protocol.dsp.http.spi.message.ContinuationTokenManager;
import org.eclipse.edc.protocol.dsp.http.spi.message.DspRequestHandler;
import org.eclipse.edc.runtime.metamodel.annotation.Extension;
Expand All @@ -38,7 +38,7 @@
import org.eclipse.edc.web.spi.WebService;
import org.eclipse.edc.web.spi.configuration.ApiContext;

import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI;
import static org.eclipse.edc.protocol.dsp.spi.type.DspConstants.DSP_TRANSFORMER_CONTEXT_V_08;
import static org.eclipse.edc.protocol.dsp.spi.type.DspConstants.DSP_TRANSFORMER_CONTEXT_V_2024_1;
import static org.eclipse.edc.protocol.dsp.spi.version.DspVersions.V_08;
Expand Down Expand Up @@ -83,7 +83,7 @@ public String name() {

@Override
public void initialize(ServiceExtensionContext context) {
validatorRegistry.register(DSPACE_TYPE_CATALOG_REQUEST_MESSAGE, CatalogRequestMessageValidator.instance(criterionOperatorRegistry));
validatorRegistry.register(DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI, CatalogRequestMessageValidator.instance(criterionOperatorRegistry));


webService.registerResource(ApiContext.PROTOCOL, new DspCatalogApiController(service, dspRequestHandler, continuationTokenManager(monitor, DSP_TRANSFORMER_CONTEXT_V_08)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import static org.eclipse.edc.protocol.dsp.catalog.http.api.CatalogApiPaths.CATALOG_REQUEST;
import static org.eclipse.edc.protocol.dsp.catalog.http.api.CatalogApiPaths.DATASET_REQUEST;
import static org.eclipse.edc.protocol.dsp.http.spi.types.HttpMessageProtocol.DATASPACE_PROTOCOL_HTTP;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI;

/**
* Provides the HTTP endpoint for receiving catalog requests.
Expand Down Expand Up @@ -83,7 +83,7 @@ public Response requestCatalog(JsonObject jsonObject, @HeaderParam(AUTHORIZATION

var request = PostDspRequest.Builder.newInstance(CatalogRequestMessage.class, Catalog.class, CatalogError.class)
.token(token)
.expectedMessageType(DSPACE_TYPE_CATALOG_REQUEST_MESSAGE)
.expectedMessageType(DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI)
.message(messageJson)
.serviceCall(service::getCatalog)
.errorProvider(CatalogError.Builder::newInstance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.eclipse.edc.spi.monitor.Monitor;
import org.eclipse.edc.spi.result.Result;

import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER_IRI;

public class ContinuationTokenManagerImpl implements ContinuationTokenManager {

Expand All @@ -36,16 +36,16 @@ public ContinuationTokenManagerImpl(Base64continuationTokenSerDes continuationTo
this.monitor = monitor;
}

@Override
public ResponseDecorator<CatalogRequestMessage, Catalog> createResponseDecorator(String requestUrl) {
return new CatalogPaginationResponseDecorator(requestUrl, continuationTokenSerDes, monitor);
}

@Override
public Result<JsonObject> applyQueryFromToken(JsonObject requestMessage, String continuationToken) {
return continuationTokenSerDes.deserialize(continuationToken)
.map(query -> Json.createArrayBuilder().add(query))
.map(filter -> Json.createObjectBuilder(requestMessage).add(DSPACE_PROPERTY_FILTER, filter))
.map(filter -> Json.createObjectBuilder(requestMessage).add(DSPACE_PROPERTY_FILTER_IRI, filter))
.map(JsonObjectBuilder::build);
}

@Override
public ResponseDecorator<CatalogRequestMessage, Catalog> createResponseDecorator(String requestUrl) {
return new CatalogPaginationResponseDecorator(requestUrl, continuationTokenSerDes, monitor);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI;
import static org.eclipse.edc.protocol.dsp.spi.version.DspVersions.V_08;
import static org.eclipse.edc.protocol.dsp.spi.version.DspVersions.V_2024_1;
import static org.mockito.ArgumentMatchers.any;
Expand Down Expand Up @@ -53,7 +53,7 @@ void setUp(ServiceExtensionContext context) {
void shouldRegisterMessageValidator(DspCatalogApiExtension extension, ServiceExtensionContext context) {
extension.initialize(context);

verify(validatorRegistry).register(eq(DSPACE_TYPE_CATALOG_REQUEST_MESSAGE), any());
verify(validatorRegistry).register(eq(DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI), any());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
import static org.eclipse.edc.protocol.dsp.catalog.http.api.CatalogApiPaths.BASE_PATH;
import static org.eclipse.edc.protocol.dsp.catalog.http.api.CatalogApiPaths.CATALOG_REQUEST;
import static org.eclipse.edc.protocol.dsp.catalog.http.api.CatalogApiPaths.DATASET_REQUEST;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.isA;
Expand Down Expand Up @@ -100,7 +100,7 @@ class RequestCatalog {

@Test
void shouldCreateResource() {
var requestBody = createObjectBuilder().add(TYPE, DSPACE_TYPE_CATALOG_REQUEST_MESSAGE).build();
var requestBody = createObjectBuilder().add(TYPE, DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI).build();
var catalog = createObjectBuilder().add(JsonLdKeywords.TYPE, "catalog").build();
when(transformerRegistry.transform(any(Catalog.class), eq(JsonObject.class))).thenReturn(Result.success(catalog));
when(dspRequestHandler.createResource(any(), any())).thenReturn(Response.ok().type(APPLICATION_JSON_TYPE).build());
Expand All @@ -119,7 +119,7 @@ void shouldCreateResource() {
var request = captor.getValue();
assertThat(request.getInputClass()).isEqualTo(CatalogRequestMessage.class);
assertThat(request.getResultClass()).isEqualTo(Catalog.class);
assertThat(request.getExpectedMessageType()).isEqualTo(DSPACE_TYPE_CATALOG_REQUEST_MESSAGE);
assertThat(request.getExpectedMessageType()).isEqualTo(DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI);
assertThat(request.getProcessId()).isNull();
assertThat(request.getToken()).isEqualTo("auth");
assertThat(request.getMessage()).isEqualTo(requestBody);
Expand All @@ -128,7 +128,7 @@ void shouldCreateResource() {

@Test
void shouldApplyContinuationToken_whenPassed() {
var requestBody = createObjectBuilder().add(TYPE, DSPACE_TYPE_CATALOG_REQUEST_MESSAGE).build();
var requestBody = createObjectBuilder().add(TYPE, DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI).build();
var catalog = createObjectBuilder().add(JsonLdKeywords.TYPE, "catalog").build();
when(transformerRegistry.transform(any(Catalog.class), eq(JsonObject.class))).thenReturn(Result.success(catalog));
when(dspRequestHandler.createResource(any(), any())).thenReturn(Response.ok().type(APPLICATION_JSON_TYPE).build());
Expand All @@ -153,7 +153,7 @@ void shouldApplyContinuationToken_whenPassed() {

@Test
void shouldReturnBadRequest_whenContinuationTokenIsNotValid() {
var requestBody = createObjectBuilder().add(TYPE, DSPACE_TYPE_CATALOG_REQUEST_MESSAGE).build();
var requestBody = createObjectBuilder().add(TYPE, DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI).build();
when(continuationTokenManager.applyQueryFromToken(any(), any())).thenReturn(Result.failure("error"));

baseRequest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER_IRI;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
Expand All @@ -38,7 +38,7 @@ void apply_shouldReplaceQueryWithTheOnePassedInTheToken() {
var result = continuationTokenManager.applyQueryFromToken(Json.createObjectBuilder().build(), "token");

assertThat(result).isSucceeded().satisfies(jsonObject -> {
assertThat(jsonObject.getJsonArray(DSPACE_PROPERTY_FILTER)).hasSize(1).first().isEqualTo(filter);
assertThat(jsonObject.getJsonArray(DSPACE_PROPERTY_FILTER_IRI)).hasSize(1).first().isEqualTo(filter);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import org.jetbrains.annotations.Nullable;

import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.TYPE;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER_IRI;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI;

/**
* Transforms a {@link CatalogRequestMessage} to a {@link JsonObject} in JSON-LD expanded form.
Expand All @@ -41,10 +41,10 @@ public JsonObjectFromCatalogRequestMessageTransformer(JsonBuilderFactory jsonFac
@Override
public @Nullable JsonObject transform(@NotNull CatalogRequestMessage message, @NotNull TransformerContext context) {
var builder = jsonFactory.createObjectBuilder();
builder.add(TYPE, DSPACE_TYPE_CATALOG_REQUEST_MESSAGE);
builder.add(TYPE, DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI);

if (message.getQuerySpec() != null) {
builder.add(DSPACE_PROPERTY_FILTER, context.transform(message.getQuerySpec(), JsonObject.class));
builder.add(DSPACE_PROPERTY_FILTER_IRI, context.transform(message.getQuerySpec(), JsonObject.class));
}

return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import java.util.Optional;

import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER_IRI;

/**
* Transforms a {@link JsonObject} in JSON-LD expanded form to a {@link CatalogRequestMessage}.
Expand All @@ -40,7 +40,7 @@ public JsonObjectToCatalogRequestMessageTransformer() {
var builder = CatalogRequestMessage.Builder.newInstance();

Optional.of(object)
.map(it -> it.get(DSPACE_PROPERTY_FILTER))
.map(it -> it.get(DSPACE_PROPERTY_FILTER_IRI))
.map(it -> transformObject(it, QuerySpec.class, context))
.ifPresent(builder::querySpec);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.TYPE;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER_IRI;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
Expand Down Expand Up @@ -61,8 +61,8 @@ void transform_returnJsonObject() {
var result = transformer.transform(message, context);

assertThat(result).isNotNull();
assertThat(result.getJsonString(TYPE).getString()).isEqualTo(DSPACE_TYPE_CATALOG_REQUEST_MESSAGE);
assertThat(result.get(DSPACE_PROPERTY_FILTER)).isEqualTo(querySpecJson);
assertThat(result.getJsonString(TYPE).getString()).isEqualTo(DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI);
assertThat(result.get(DSPACE_PROPERTY_FILTER_IRI)).isEqualTo(querySpecJson);
verify(context, never()).reportProblem(anyString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.TYPE;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER_IRI;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
Expand All @@ -52,8 +52,8 @@ void transform_returnCatalogRequestMessage() {
when(context.transform(querySpecJson, QuerySpec.class)).thenReturn(querySpec);

var message = jsonFactory.createObjectBuilder()
.add(TYPE, DSPACE_TYPE_CATALOG_REQUEST_MESSAGE)
.add(DSPACE_PROPERTY_FILTER, querySpecJson)
.add(TYPE, DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI)
.add(DSPACE_PROPERTY_FILTER_IRI, querySpecJson)
.build();

var result = transformer.transform(message, context);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Bayerische Motoren Werke Aktiengesellschaft (BMW AG) - initial API and implementation
*
*/

plugins {
`java-library`
}

dependencies {
api(project(":data-protocols:dsp:dsp-spi"))
implementation(project(":core:common:lib:validator-lib"))

testImplementation(project(":core:common:junit"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
*/

package org.eclipse.edc.protocol.dsp.catalog.http.api.validation;
package org.eclipse.edc.protocol.dsp.catalog.validation;

import jakarta.json.JsonObject;
import org.eclipse.edc.spi.query.CriterionOperatorRegistry;
Expand All @@ -21,17 +21,22 @@
import org.eclipse.edc.validator.jsonobject.validators.model.QuerySpecValidator;
import org.eclipse.edc.validator.spi.Validator;

import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE;
import static org.eclipse.edc.jsonld.spi.Namespaces.DSPACE_SCHEMA;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_PROPERTY_FILTER_TERM;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_TERM;

/**
* Validator for {@link CatalogRequestMessageValidator} Json-LD representation
*/
public class CatalogRequestMessageValidator {
public static Validator<JsonObject> instance(CriterionOperatorRegistry criterionOperatorRegistry) {
return instance(criterionOperatorRegistry, DSPACE_SCHEMA);
}

public static Validator<JsonObject> instance(CriterionOperatorRegistry criterionOperatorRegistry, String schema) {
return JsonObjectValidator.newValidator()
.verify(path -> new TypeIs(path, DSPACE_TYPE_CATALOG_REQUEST_MESSAGE))
.verifyObject(DSPACE_PROPERTY_FILTER, path -> QuerySpecValidator.instance(path, criterionOperatorRegistry))
.verify(path -> new TypeIs(path, schema + DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_TERM))
.verifyObject(schema + DSPACE_PROPERTY_FILTER_TERM, path -> QuerySpecValidator.instance(path, criterionOperatorRegistry))
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
*
*/

package org.eclipse.edc.protocol.dsp.catalog.http.api.validation;
package org.eclipse.edc.protocol.dsp.catalog.validation;

import jakarta.json.Json;
import jakarta.json.JsonObject;
import org.assertj.core.api.Assertions;
import org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames;
import org.eclipse.edc.validator.spi.ValidationFailure;
import org.eclipse.edc.validator.spi.Validator;
import org.eclipse.edc.validator.spi.Violation;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.InstanceOfAssertFactories.list;
import static org.eclipse.edc.jsonld.spi.JsonLdKeywords.TYPE;
import static org.eclipse.edc.junit.assertions.AbstractResultAssert.assertThat;
import static org.eclipse.edc.protocol.dsp.spi.type.DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE;
import static org.mockito.Mockito.mock;

class CatalogRequestMessageValidatorTest {
Expand All @@ -35,7 +35,7 @@ class CatalogRequestMessageValidatorTest {
@Test
void shouldSucceed_whenObjectIsValid() {
var input = Json.createObjectBuilder()
.add(TYPE, Json.createArrayBuilder().add(DSPACE_TYPE_CATALOG_REQUEST_MESSAGE))
.add(TYPE, Json.createArrayBuilder().add(DspCatalogPropertyAndTypeNames.DSPACE_TYPE_CATALOG_REQUEST_MESSAGE_IRI))
.build();

var result = validator.validate(input);
Expand All @@ -52,6 +52,6 @@ void shouldFail_whenMandatoryFieldsAreMissing() {

assertThat(result).isFailed().extracting(ValidationFailure::getViolations).asInstanceOf(list(Violation.class))
.hasSize(1)
.anySatisfy(violation -> assertThat(violation.path()).isEqualTo(TYPE));
.anySatisfy(violation -> Assertions.assertThat(violation.path()).isEqualTo(TYPE));
}
}
Loading
Loading