@Test public void testSetNullChannel() throws InvalidArgumentException { thrown.expect(InvalidArgumentException.class); thrown.expectMessage("setChannel Channel can not be null"); orderer.setChannel(null); }
void setChannel(Channel channel) throws InvalidArgumentException { if (channel == null) { throw new InvalidArgumentException("setChannel Channel can not be null"); } if (null != this.channel && this.channel != channel) { throw new InvalidArgumentException(format("Can not add orderer %s to channel %s because it already belongs to channel %s.", name, channel.getName(), this.channel.getName())); } this.channel = channel; }
Orderer implements Serializable { void setChannel(Channel channel) throws InvalidArgumentException { if (channel == null) { throw new InvalidArgumentException("setChannel Channel can not be null"); } if (null != this.channel && this.channel != channel) { throw new InvalidArgumentException(format("Can not add orderer %s to channel %s because it already belongs to channel %s.", name, channel.getName(), this.channel.getName())); } this.channel = channel; } }
Orderer implements Serializable { void setChannel(Channel channel) throws InvalidArgumentException { if (channel == null) { throw new InvalidArgumentException("setChannel Channel can not be null"); } if (null != this.channel && this.channel != channel) { throw new InvalidArgumentException(format("Can not add orderer %s to channel %s because it already belongs to channel %s.", name, channel.getName(), this.channel.getName())); } this.channel = channel; } Orderer(String name, String url, Properties properties); }
Orderer implements Serializable { void setChannel(Channel channel) throws InvalidArgumentException { if (channel == null) { throw new InvalidArgumentException("setChannel Channel can not be null"); } if (null != this.channel && this.channel != channel) { throw new InvalidArgumentException(format("Can not add orderer %s to channel %s because it already belongs to channel %s.", name, channel.getName(), this.channel.getName())); } this.channel = channel; } Orderer(String name, String url, Properties properties); Properties getProperties(); String getName(); String getUrl(); }
Orderer implements Serializable { void setChannel(Channel channel) throws InvalidArgumentException { if (channel == null) { throw new InvalidArgumentException("setChannel Channel can not be null"); } if (null != this.channel && this.channel != channel) { throw new InvalidArgumentException(format("Can not add orderer %s to channel %s because it already belongs to channel %s.", name, channel.getName(), this.channel.getName())); } this.channel = channel; } Orderer(String name, String url, Properties properties); Properties getProperties(); String getName(); String getUrl();  }