Peer implements Serializable { FabricProposalResponse.ProposalResponse sendProposal(FabricProposal.SignedProposal proposal) throws PeerException, InvalidArgumentException { checkSendProposal(proposal); logger.debug(format("peer.sendProposalAsync name: %s, url: %s", name, url)); EndorserClient localEndorserClient = endorserClent; if (null == localEndorserClient || !localEndorserClient.isChannelActive()) { endorserClent = new EndorserClient(new Endpoint(url, properties).getChannelBuilder()); localEndorserClient = endorserClent; } try { return localEndorserClient.sendProposal(proposal); } catch (Throwable t) { endorserClent = null; throw t; } } Peer(String name, String grpcURL, Properties properties); String getName(); Properties getProperties(); String getUrl(); @Override boolean equals(Object otherPeer); @Override int hashCode(); @Override String toString();  }
@Test (expected = PeerException.class) public void testSendNullProposal() throws PeerException, InvalidArgumentException { peer.sendProposal(null); Assert.fail("Expected null proposal to throw exception."); }
@Test (expected = PeerException.class) public void testSendNullChannel() throws InvalidArgumentException, PeerException { Peer badpeer = hfclient.newPeer("badpeer", "grpc: badpeer.sendProposal(FabricProposal.SignedProposal.newBuilder().build()); Assert.fail("Expected peer with no channel throw exception"); }