Search in sources :

Example 1 with MonitorProperties

use of com.hedera.mirror.monitor.MonitorProperties in project hedera-mirror-node by hashgraph.

the class TransactionPublisherTest method setup.

@BeforeEach
void setup() throws IOException {
    publishScenarioProperties = new PublishScenarioProperties();
    publishScenarioProperties.setName("test");
    publishScenarioProperties.setType(TransactionType.CRYPTO_TRANSFER);
    monitorProperties = new MonitorProperties();
    monitorProperties.setNodes(Set.of(new NodeProperties("0.0.3", "in-process:test")));
    monitorProperties.getNodeValidation().setEnabled(false);
    OperatorProperties operatorProperties = monitorProperties.getOperator();
    operatorProperties.setAccountId("0.0.100");
    operatorProperties.setPrivateKey(PrivateKey.generate().toString());
    publishProperties = new PublishProperties();
    transactionPublisher = new TransactionPublisher(monitorProperties, publishProperties);
    cryptoServiceStub = new CryptoServiceStub();
    server = InProcessServerBuilder.forName("test").addService(cryptoServiceStub).directExecutor().build().start();
}
Also used : NodeProperties(com.hedera.mirror.monitor.NodeProperties) OperatorProperties(com.hedera.mirror.monitor.OperatorProperties) MonitorProperties(com.hedera.mirror.monitor.MonitorProperties) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with MonitorProperties

use of com.hedera.mirror.monitor.MonitorProperties in project hedera-mirror-node by hashgraph.

the class GrpcClientSDKTest method setup.

@BeforeEach
void setup(TestInfo testInfo) throws Exception {
    log.info("Executing: {}", testInfo.getDisplayName());
    properties = new GrpcSubscriberProperties();
    properties.setName(testInfo.getDisplayName());
    properties.setTopicId("0.0.1000");
    subscription = new GrpcSubscription(1, properties);
    monitorProperties = new MonitorProperties();
    monitorProperties.getMirrorNode().getGrpc().setHost("in-process:test");
    grpcClientSDK = new GrpcClientSDK(monitorProperties, new SubscribeProperties());
    consensusServiceStub = new ConsensusServiceStub();
    server = InProcessServerBuilder.forName("test").addService(consensusServiceStub).build().start();
}
Also used : SubscribeProperties(com.hedera.mirror.monitor.subscribe.SubscribeProperties) MonitorProperties(com.hedera.mirror.monitor.MonitorProperties) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with MonitorProperties

use of com.hedera.mirror.monitor.MonitorProperties in project hedera-mirror-node by hashgraph.

the class RestSubscriberTest method setup.

@BeforeEach
void setup() {
    MonitorProperties monitorProperties = new MonitorProperties();
    monitorProperties.setMirrorNode(new MirrorNodeProperties());
    monitorProperties.getMirrorNode().getRest().setHost("127.0.0.1");
    restSubscriberProperties = new RestSubscriberProperties();
    restSubscriberProperties.setLimit(3L);
    restSubscriberProperties.setName("test");
    restSubscriberProperties.getRetry().setMaxAttempts(2L);
    restSubscriberProperties.getRetry().setMinBackoff(Duration.ofNanos(1L));
    restSubscriberProperties.getRetry().setMaxBackoff(Duration.ofNanos(2L));
    PublishScenarioProperties publishScenarioProperties = new PublishScenarioProperties();
    publishScenarioProperties.setName(SCENARIO);
    publishScenarioProperties.setType(TransactionType.CONSENSUS_SUBMIT_MESSAGE);
    publishScenario = new PublishScenario(publishScenarioProperties);
    subscribeProperties = new SubscribeProperties();
    subscribeProperties.getRest().put(restSubscriberProperties.getName(), restSubscriberProperties);
    WebClient.Builder builder = WebClient.builder().exchangeFunction(exchangeFunction);
    restSubscriber = new RestSubscriber(monitorProperties, subscribeProperties, builder);
}
Also used : SubscribeProperties(com.hedera.mirror.monitor.subscribe.SubscribeProperties) PublishScenarioProperties(com.hedera.mirror.monitor.publish.PublishScenarioProperties) MirrorNodeProperties(com.hedera.mirror.monitor.MirrorNodeProperties) WebClient(org.springframework.web.reactive.function.client.WebClient) MonitorProperties(com.hedera.mirror.monitor.MonitorProperties) PublishScenario(com.hedera.mirror.monitor.publish.PublishScenario) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

MonitorProperties (com.hedera.mirror.monitor.MonitorProperties)3 BeforeEach (org.junit.jupiter.api.BeforeEach)3 SubscribeProperties (com.hedera.mirror.monitor.subscribe.SubscribeProperties)2 MirrorNodeProperties (com.hedera.mirror.monitor.MirrorNodeProperties)1 NodeProperties (com.hedera.mirror.monitor.NodeProperties)1 OperatorProperties (com.hedera.mirror.monitor.OperatorProperties)1 PublishScenario (com.hedera.mirror.monitor.publish.PublishScenario)1 PublishScenarioProperties (com.hedera.mirror.monitor.publish.PublishScenarioProperties)1 WebClient (org.springframework.web.reactive.function.client.WebClient)1