Search in sources :

Example 6 with AddressBookQuery

use of com.hedera.mirror.api.proto.AddressBookQuery in project hedera-mirror-node by hashgraph.

the class NetworkControllerTest method missingFileId.

@Test
void missingFileId() {
    AddressBookQuery query = AddressBookQuery.newBuilder().build();
    reactiveService.getNodes(Mono.just(query)).as(StepVerifier::create).expectErrorSatisfies(t -> assertException(t, Status.Code.INVALID_ARGUMENT, "fileId: must not be null")).verify(Duration.ofSeconds(1L));
}
Also used : FileID(com.hederahashgraph.api.proto.java.FileID) AddressBookQuery(com.hedera.mirror.api.proto.AddressBookQuery) ServiceEndpoint(com.hederahashgraph.api.proto.java.ServiceEndpoint) GrpcClient(net.devh.boot.grpc.client.inject.GrpcClient) StepVerifier(reactor.test.StepVerifier) EntityId(com.hedera.mirror.common.domain.entity.EntityId) GrpcIntegrationTest(com.hedera.mirror.grpc.GrpcIntegrationTest) AddressBook(com.hedera.mirror.common.domain.addressbook.AddressBook) ProtoUtil(com.hedera.mirror.grpc.util.ProtoUtil) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Resource(javax.annotation.Resource) Mono(reactor.core.publisher.Mono) AddressBookEntry(com.hedera.mirror.common.domain.addressbook.AddressBookEntry) ByteString(com.google.protobuf.ByteString) StatusRuntimeException(io.grpc.StatusRuntimeException) InetAddress(java.net.InetAddress) Test(org.junit.jupiter.api.Test) ReactorNetworkServiceGrpc(com.hedera.mirror.api.proto.ReactorNetworkServiceGrpc) Duration(java.time.Duration) DomainBuilder(com.hedera.mirror.common.domain.DomainBuilder) Log4j2(lombok.extern.log4j.Log4j2) NodeAddress(com.hederahashgraph.api.proto.java.NodeAddress) Status(io.grpc.Status) AddressBookQuery(com.hedera.mirror.api.proto.AddressBookQuery) StepVerifier(reactor.test.StepVerifier) GrpcIntegrationTest(com.hedera.mirror.grpc.GrpcIntegrationTest) Test(org.junit.jupiter.api.Test)

Example 7 with AddressBookQuery

use of com.hedera.mirror.api.proto.AddressBookQuery in project hedera-mirror-node by hashgraph.

the class NetworkControllerTest method noLimit.

@Test
void noLimit() {
    AddressBook addressBook = addressBook();
    AddressBookEntry addressBookEntry1 = addressBookEntry();
    AddressBookEntry addressBookEntry2 = addressBookEntry();
    AddressBookQuery query = AddressBookQuery.newBuilder().setFileId(FileID.newBuilder().setFileNum(addressBook.getFileId().getEntityNum()).build()).build();
    reactiveService.getNodes(Mono.just(query)).as(StepVerifier::create).thenAwait(Duration.ofMillis(50)).consumeNextWith(n -> assertEntry(addressBookEntry1, n)).consumeNextWith(n -> assertEntry(addressBookEntry2, n)).expectComplete().verify(Duration.ofSeconds(1L));
}
Also used : FileID(com.hederahashgraph.api.proto.java.FileID) AddressBookQuery(com.hedera.mirror.api.proto.AddressBookQuery) ServiceEndpoint(com.hederahashgraph.api.proto.java.ServiceEndpoint) GrpcClient(net.devh.boot.grpc.client.inject.GrpcClient) StepVerifier(reactor.test.StepVerifier) EntityId(com.hedera.mirror.common.domain.entity.EntityId) GrpcIntegrationTest(com.hedera.mirror.grpc.GrpcIntegrationTest) AddressBook(com.hedera.mirror.common.domain.addressbook.AddressBook) ProtoUtil(com.hedera.mirror.grpc.util.ProtoUtil) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Resource(javax.annotation.Resource) Mono(reactor.core.publisher.Mono) AddressBookEntry(com.hedera.mirror.common.domain.addressbook.AddressBookEntry) ByteString(com.google.protobuf.ByteString) StatusRuntimeException(io.grpc.StatusRuntimeException) InetAddress(java.net.InetAddress) Test(org.junit.jupiter.api.Test) ReactorNetworkServiceGrpc(com.hedera.mirror.api.proto.ReactorNetworkServiceGrpc) Duration(java.time.Duration) DomainBuilder(com.hedera.mirror.common.domain.DomainBuilder) Log4j2(lombok.extern.log4j.Log4j2) NodeAddress(com.hederahashgraph.api.proto.java.NodeAddress) Status(io.grpc.Status) AddressBookQuery(com.hedera.mirror.api.proto.AddressBookQuery) AddressBook(com.hedera.mirror.common.domain.addressbook.AddressBook) AddressBookEntry(com.hedera.mirror.common.domain.addressbook.AddressBookEntry) GrpcIntegrationTest(com.hedera.mirror.grpc.GrpcIntegrationTest) Test(org.junit.jupiter.api.Test)

Aggregations

AddressBookQuery (com.hedera.mirror.api.proto.AddressBookQuery)7 AddressBook (com.hedera.mirror.common.domain.addressbook.AddressBook)7 AddressBookEntry (com.hedera.mirror.common.domain.addressbook.AddressBookEntry)7 GrpcIntegrationTest (com.hedera.mirror.grpc.GrpcIntegrationTest)7 Test (org.junit.jupiter.api.Test)7 StepVerifier (reactor.test.StepVerifier)7 ByteString (com.google.protobuf.ByteString)6 ReactorNetworkServiceGrpc (com.hedera.mirror.api.proto.ReactorNetworkServiceGrpc)6 DomainBuilder (com.hedera.mirror.common.domain.DomainBuilder)6 EntityId (com.hedera.mirror.common.domain.entity.EntityId)6 ProtoUtil (com.hedera.mirror.grpc.util.ProtoUtil)6 FileID (com.hederahashgraph.api.proto.java.FileID)6 NodeAddress (com.hederahashgraph.api.proto.java.NodeAddress)6 ServiceEndpoint (com.hederahashgraph.api.proto.java.ServiceEndpoint)6 Status (io.grpc.Status)6 StatusRuntimeException (io.grpc.StatusRuntimeException)6 InetAddress (java.net.InetAddress)6 Duration (java.time.Duration)6 Resource (javax.annotation.Resource)6 Log4j2 (lombok.extern.log4j.Log4j2)6