Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-schmidt committed Feb 24, 2024
1 parent 9308207 commit 419504d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,11 @@
*/
package de.fraunhofer.iosb.client.policy;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import de.fraunhofer.iosb.client.exception.AmbiguousOrNullException;
import de.fraunhofer.iosb.client.util.Pair;
import jakarta.json.Json;
import jakarta.json.JsonObject;
import static java.lang.String.format;
import static org.eclipse.edc.protocol.dsp.spi.types.HttpMessageProtocol.DATASPACE_PROTOCOL_HTTP;
import static org.eclipse.edc.spi.query.Criterion.criterion;

import java.io.ByteArrayInputStream;
import java.net.URL;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.eclipse.edc.catalog.spi.Catalog;
import org.eclipse.edc.catalog.spi.DataService;
import org.eclipse.edc.catalog.spi.Dataset;
import org.eclipse.edc.catalog.spi.Distribution;
import org.eclipse.edc.connector.spi.catalog.CatalogService;
import org.eclipse.edc.jsonld.TitaniumJsonLd;
import org.eclipse.edc.jsonld.spi.JsonLd;
Expand All @@ -55,7 +33,6 @@
import org.eclipse.edc.transform.spi.TypeTransformerRegistry;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.net.URL;
import java.util.Collection;
import java.util.List;
Expand All @@ -68,16 +45,8 @@
import java.util.stream.Stream;

import static java.lang.String.format;
import static org.eclipse.edc.jsonld.spi.Namespaces.*;
import static org.eclipse.edc.jsonld.spi.PropertyAndTypeNames.DCAT_ACCESS_SERVICE_ATTRIBUTE;
import static org.eclipse.edc.jsonld.spi.PropertyAndTypeNames.DCT_FORMAT_ATTRIBUTE;
import static org.eclipse.edc.policy.model.OdrlNamespace.ODRL_PREFIX;
import static org.eclipse.edc.policy.model.OdrlNamespace.ODRL_SCHEMA;
import static org.eclipse.edc.protocol.dsp.spi.types.HttpMessageProtocol.DATASPACE_PROTOCOL_HTTP;
import static org.eclipse.edc.spi.query.Criterion.criterion;
import de.fraunhofer.iosb.client.exception.AmbiguousOrNullException;
import de.fraunhofer.iosb.client.util.Pair;
import jakarta.json.Json;

/**
* Finds out policy for a given asset id and provider EDC url
Expand All @@ -87,7 +56,7 @@ class PolicyService {
private static final String CATALOG_RETRIEVAL_FAILURE_MSG = "Catalog by provider %s couldn't be retrieved: %s";
private final CatalogService catalogService;
private final TypeTransformerRegistry transformer;

private final PolicyServiceConfig config;
private final PolicyDefinitionStore policyDefinitionStore;

Expand All @@ -100,7 +69,7 @@ class PolicyService {
* @param transformer Transform json-ld byte-array catalog to catalog class
*/
public PolicyService(CatalogService catalogService, TypeTransformerRegistry transformer,
PolicyServiceConfig config, PolicyDefinitionStore policyDefinitionStore, Monitor monitor) {
PolicyServiceConfig config, PolicyDefinitionStore policyDefinitionStore, Monitor monitor) {
this.catalogService = catalogService;
this.transformer = transformer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import java.util.UUID;

import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;

public class TransferInitiatorTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public class NegotiatorTest {
private final ConsumerContractNegotiationManager ccnmMock = mock(ConsumerContractNegotiationManager.class);
private final ContractNegotiationStore cnsMock = mock(ContractNegotiationStore.class);
private final ContractNegotiationObservable contractNegotiationObservable = new ContractNegotiationObservableImpl();
private final Config configMock = ConfigFactory.empty();

private final String assetId = "test-asset-id";
private final Policy mockPolicy = buildPolicy();
Expand Down

0 comments on commit 419504d

Please sign in to comment.