use of org.eclipse.dataspaceconnector.spi.monitor.Monitor in project edc-showcase by microsoft.
the class CatalogDataseedingExtension method initialize.
@Override
public void initialize(ServiceExtensionContext context) {
Monitor monitor = context.getMonitor();
var nodesFile = context.getSetting(NODES_FILE_SETTING, "nodes.json");
monitor.info("Using FCC Node directory file " + nodesFile);
// generate+save assets
var assets = createAssets(context.getConnectorId());
assets.forEach(assetIndexLoader::accept);
// generate+save policies
var accessPolicies = IntStream.range(0, 10).mapToObj(i -> createAccessPolicy("edc-demo-access-policy-" + i)).peek(policyStore::save).collect(Collectors.toList());
var contractPolicies = IntStream.range(0, 10).mapToObj(i -> createContractPolicy("edc-demo-contract-policy-" + i)).peek(policyStore::save).collect(Collectors.toList());
// publish asset
assets.stream().map(AssetEntry::getAsset).forEach(a -> publishAsset(a, random(accessPolicies), random(contractPolicies)));
// populate node directory
var nodes = readNodesFromJson(nodesFile);
nodes.forEach(nodeDirectory::insert);
monitor.info("Catalog Data seeding done");
}
use of org.eclipse.dataspaceconnector.spi.monitor.Monitor in project edc-showcase by microsoft.
the class IdentityHubCredentialsVerifierTest method setUp.
@BeforeEach
void setUp() throws NoSuchAlgorithmException {
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(2048);
KeyPair kp = kpg.generateKeyPair();
publicKey = (RSAPublicKey) kp.getPublic();
hubClient = EasyMock.createMock(IdentityHubClient.class);
credentialsVerifier = new IdentityHubCredentialsVerifier(hubClient, new Monitor() {
}, "did:ion:test");
}
use of org.eclipse.dataspaceconnector.spi.monitor.Monitor in project product-edc by catenax-ng.
the class BusinessPartnerValidationExtensionTest method setup.
@BeforeEach
public void setup() {
policyEngine = Mockito.mock(PolicyEngine.class);
ruleBindingRegistry = Mockito.mock(RuleBindingRegistry.class);
final Monitor monitor = Mockito.mock(Monitor.class);
serviceExtensionContext = Mockito.mock(ServiceExtensionContext.class);
Mockito.when(serviceExtensionContext.getMonitor()).thenReturn(monitor);
Mockito.when(serviceExtensionContext.getService(PolicyEngine.class)).thenReturn(policyEngine);
Mockito.when(serviceExtensionContext.getService(RuleBindingRegistry.class)).thenReturn(ruleBindingRegistry);
extension = new BusinessPartnerValidationExtension();
}
use of org.eclipse.dataspaceconnector.spi.monitor.Monitor in project DataSpaceConnector by eclipse-dataspaceconnector.
the class TransferProcessManagerImplTest method setup.
@BeforeEach
void setup() {
var resourceManifest = ResourceManifest.Builder.newInstance().definitions(List.of(new TestResourceDefinition())).build();
when(manifestGenerator.generateResourceManifest(any(TransferProcess.class))).thenReturn(resourceManifest);
manager = TransferProcessManagerImpl.Builder.newInstance().provisionManager(provisionManager).dataFlowManager(mock(DataFlowManager.class)).waitStrategy(mock(ExponentialWaitStrategy.class)).batchSize(TRANSFER_MANAGER_BATCHSIZE).dispatcherRegistry(dispatcherRegistry).manifestGenerator(manifestGenerator).monitor(mock(Monitor.class)).commandQueue(mock(CommandQueue.class)).commandRunner(mock(CommandRunner.class)).typeManager(new TypeManager()).statusCheckerRegistry(statusCheckerRegistry).observable(mock(TransferProcessObservable.class)).store(store).build();
}
use of org.eclipse.dataspaceconnector.spi.monitor.Monitor in project DataSpaceConnector by eclipse-dataspaceconnector.
the class TransferProcessManagerImplIntegrationTest method setup.
@SuppressWarnings("unchecked")
@BeforeEach
void setup() {
var resourceManifest = ResourceManifest.Builder.newInstance().definitions(List.of(new TestResourceDefinition())).build();
when(manifestGenerator.generateConsumerResourceManifest(any(DataRequest.class), any(Policy.class))).thenReturn(resourceManifest);
var policyArchive = mock(PolicyArchive.class);
when(policyArchive.findPolicyForContract(anyString())).thenReturn(Policy.Builder.newInstance().build());
transferProcessManager = TransferProcessManagerImpl.Builder.newInstance().provisionManager(provisionManager).dataFlowManager(mock(DataFlowManager.class)).waitStrategy(mock(ExponentialWaitStrategy.class)).batchSize(TRANSFER_MANAGER_BATCHSIZE).dispatcherRegistry(mock(RemoteMessageDispatcherRegistry.class)).manifestGenerator(manifestGenerator).monitor(mock(Monitor.class)).commandQueue(mock(CommandQueue.class)).commandRunner(mock(CommandRunner.class)).typeManager(new TypeManager()).statusCheckerRegistry(mock(StatusCheckerRegistry.class)).observable(mock(TransferProcessObservable.class)).transferProcessStore(store).policyArchive(policyArchive).addressResolver(mock(DataAddressResolver.class)).build();
}
Aggregations