Skip to content

Commit

Permalink
checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Dec 28, 2023
1 parent caa15fe commit b50e2cb
Showing 5 changed files with 53 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
/*
* Copyright (c) 2023 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
*
*/

package org.eclipse.edc.catalog.cache;

import org.eclipse.edc.crawler.spi.model.UpdateResponse;
Original file line number Diff line number Diff line change
@@ -90,9 +90,9 @@ void verify_successHandler_persistIsCalled(ServiceExtensionContext context) {
when(context.getSetting(eq("edc.catalog.cache.execution.delay.seconds"), any())).thenReturn("0");
when(nodeDirectoryMock.getAll()).thenReturn(List.of(createNode()));
extension.initialize(context);
var crawlerACtion = mock(CrawlerAction.class);
when(crawlerACtion.apply(any())).thenReturn(completedFuture(new CatalogUpdateResponse("test-url", createCatalog("test-catalog"))));
extension.createNodeQueryAdapterRegistry(context).register(TEST_PROTOCOL, crawlerACtion);
var crawlerAction = mock(CrawlerAction.class);
when(crawlerAction.apply(any())).thenReturn(completedFuture(new CatalogUpdateResponse("test-url", createCatalog("test-catalog"))));
extension.createNodeQueryAdapterRegistry(context).register(TEST_PROTOCOL, crawlerAction);

extension.start();

Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
/*
* Copyright (c) 2023 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
*
*/

package org.eclipse.edc.catalog.spi.model;

import com.fasterxml.jackson.annotation.JsonCreator;
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
/*
* Copyright (c) 2023 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
*
*/

package org.eclipse.edc.end2end;

public record Endpoint(String path, String port) {
Original file line number Diff line number Diff line change
@@ -40,8 +40,8 @@ class ManagementApiClient {
private static final TypeReference<List<Map<String, Object>>> LIST_TYPE_REFERENCE = new TypeReference<>() {
};
private static final MediaType JSON = MediaType.parse("application/json");
private final String MANAGEMENT_BASE_URL;
private final String CATALOG_BASE_URL;
private final String managementBaseUrl;
private final String catalogBaseUrl;
private final ObjectMapper mapper;
private final JsonLd jsonLdService;
private final TypeTransformerRegistry typeTransformerRegistry;
@@ -52,20 +52,20 @@ class ManagementApiClient {
this.mapper = mapper;
this.jsonLdService = jsonLdService;
this.typeTransformerRegistry = typeTransformerRegistry;
MANAGEMENT_BASE_URL = "http://localhost:%s%s".formatted(connectorManagement.port(), connectorManagement.path());
CATALOG_BASE_URL = "http://localhost:%s%s".formatted(catalogManagement.port(), catalogManagement.path());
managementBaseUrl = "http://localhost:%s%s".formatted(connectorManagement.port(), connectorManagement.path());
catalogBaseUrl = "http://localhost:%s%s".formatted(catalogManagement.port(), catalogManagement.path());
}

Result<String> postAsset(JsonObject entry) {
return postObjectWithId(createPostRequest(entry, MANAGEMENT_BASE_URL + "/v3/assets"));
return postObjectWithId(createPostRequest(entry, managementBaseUrl + "/v3/assets"));
}

Result<String> postPolicy(String policyJsonLd) {
return postObjectWithId(createPostRequest(policyJsonLd, MANAGEMENT_BASE_URL + "/v2/policydefinitions"));
return postObjectWithId(createPostRequest(policyJsonLd, managementBaseUrl + "/v2/policydefinitions"));
}

Result<String> postContractDefinition(JsonObject definition) {
return postObjectWithId(createPostRequest(definition, MANAGEMENT_BASE_URL + "/v2/contractdefinitions"));
return postObjectWithId(createPostRequest(definition, managementBaseUrl + "/v2/contractdefinitions"));
}

List<Catalog> getContractOffers() {
@@ -89,7 +89,7 @@ List<Catalog> getContractOffers() {
}

private String catalog(String path) {
return CATALOG_BASE_URL + path;
return catalogBaseUrl + path;
}

@NotNull

0 comments on commit b50e2cb

Please sign in to comment.