@Test(expected = IllegalArgumentException.class) public void testValidateServiceNull() { cluster = new Cluster("nacos-cluster-1", null); cluster.validate(); }
public void validate() { Assert.notNull(getName(), "cluster name cannot be null"); Assert.notNull(service, "service cannot be null"); if (!getName().matches(CLUSTER_NAME_SYNTAX)) { throw new IllegalArgumentException( "cluster name can only have these characters: 0-9a-zA-Z-, current: " + getName()); } }
Cluster extends com.alibaba.nacos.api.naming.pojo.Cluster implements Cloneable { public void validate() { Assert.notNull(getName(), "cluster name cannot be null"); Assert.notNull(service, "service cannot be null"); if (!getName().matches(CLUSTER_NAME_SYNTAX)) { throw new IllegalArgumentException( "cluster name can only have these characters: 0-9a-zA-Z-, current: " + getName()); } } }
Cluster extends com.alibaba.nacos.api.naming.pojo.Cluster implements Cloneable { public void validate() { Assert.notNull(getName(), "cluster name cannot be null"); Assert.notNull(service, "service cannot be null"); if (!getName().matches(CLUSTER_NAME_SYNTAX)) { throw new IllegalArgumentException( "cluster name can only have these characters: 0-9a-zA-Z-, current: " + getName()); } } Cluster();  Cluster(String clusterName, Service service); }
Cluster extends com.alibaba.nacos.api.naming.pojo.Cluster implements Cloneable { public void validate() { Assert.notNull(getName(), "cluster name cannot be null"); Assert.notNull(service, "service cannot be null"); if (!getName().matches(CLUSTER_NAME_SYNTAX)) { throw new IllegalArgumentException( "cluster name can only have these characters: 0-9a-zA-Z-, current: " + getName()); } } Cluster();  Cluster(String clusterName, Service service); @SuppressWarnings("checkstyle:abbreviationaswordinname") int getDefIPPort(); @SuppressWarnings("checkstyle:abbreviationaswordinname") void setDefIPPort(int defIpPort); List<Instance> allIPs(); List<Instance> allIPs(boolean ephemeral); void init(); void destroy(); @JsonIgnore HealthCheckTask getHealthCheckTask(); Service getService(); void setService(Service service); @Deprecated @Override void setServiceName(String serviceName); @Override String getServiceName(); @Override Cluster clone(); boolean isEmpty(); void updateIps(List<Instance> ips, boolean ephemeral); @Override int hashCode(); @Override boolean equals(Object obj); int getDefCkport(); void setDefCkport(int defCkport); void update(Cluster cluster); String getSitegroup(); void setSitegroup(String sitegroup); boolean contains(Instance ip); void validate(); }
Cluster extends com.alibaba.nacos.api.naming.pojo.Cluster implements Cloneable { public void validate() { Assert.notNull(getName(), "cluster name cannot be null"); Assert.notNull(service, "service cannot be null"); if (!getName().matches(CLUSTER_NAME_SYNTAX)) { throw new IllegalArgumentException( "cluster name can only have these characters: 0-9a-zA-Z-, current: " + getName()); } } Cluster();  Cluster(String clusterName, Service service); @SuppressWarnings("checkstyle:abbreviationaswordinname") int getDefIPPort(); @SuppressWarnings("checkstyle:abbreviationaswordinname") void setDefIPPort(int defIpPort); List<Instance> allIPs(); List<Instance> allIPs(boolean ephemeral); void init(); void destroy(); @JsonIgnore HealthCheckTask getHealthCheckTask(); Service getService(); void setService(Service service); @Deprecated @Override void setServiceName(String serviceName); @Override String getServiceName(); @Override Cluster clone(); boolean isEmpty(); void updateIps(List<Instance> ips, boolean ephemeral); @Override int hashCode(); @Override boolean equals(Object obj); int getDefCkport(); void setDefCkport(int defCkport); void update(Cluster cluster); String getSitegroup(); void setSitegroup(String sitegroup); boolean contains(Instance ip); void validate();  }