use of io.grpc.protobuf.services.ChannelzTestHelper.TestChannel in project grpc-java by grpc.
the class ChannelzProtoUtilTest method toSubchannel_subchannelChildren.
@Test
public void toSubchannel_subchannelChildren() throws Exception {
TestChannel subchannel1 = new TestChannel();
subchannel.stats = toBuilder(subchannel.stats).setSubchannels(ImmutableList.<InternalWithLogId>of(subchannel1)).build();
assertEquals(subchannelProto.toBuilder().addSubchannelRef(ChannelzProtoUtil.toSubchannelRef(subchannel1)).build(), ChannelzProtoUtil.toSubchannel(subchannel));
TestChannel subchannel2 = new TestChannel();
subchannel.stats = toBuilder(subchannel.stats).setSubchannels(ImmutableList.<InternalWithLogId>of(subchannel1, subchannel2)).build();
assertEquals(subchannelProto.toBuilder().addSubchannelRef(ChannelzProtoUtil.toSubchannelRef(subchannel1)).addSubchannelRef(ChannelzProtoUtil.toSubchannelRef(subchannel2)).build(), ChannelzProtoUtil.toSubchannel(subchannel));
}
Aggregations