示例#1
0
  public static Clusters getClustersDetails() {
    Cluster cluster = new Cluster();
    cluster.setDataCenter(DataCenter.DFW);
    cluster.setDescription("aDesc");
    cluster.setName("aClusterName");

    Cluster cluster2 = new Cluster();
    cluster2.setDataCenter((DataCenter) rndChoice(DataCenter.values()));
    cluster2.setDescription("aDesc");
    cluster2.setName("aSecondCluster");

    Clusters clusters = new Clusters();
    clusters.getClusters().add(cluster);
    clusters.getClusters().add(cluster2);

    return clusters;
  }
    @Before
    public void standUp() {
      cTest = new ClusterValidator();

      cluster = new Cluster();
      cluster.setDescription("a-new-cluster");
      cluster.setName("a-cluster-name");
      cluster.setDataCenter(DataCenter.DFW);
      cluster.setUsername("username");
      cluster.setPassword("password");
    }
 @Test
 public void shouldRejectNullDataCenter() {
   cluster.setDataCenter(null);
   ValidatorResult result = cTest.validate(cluster, POST);
   assertFalse(resultMessage(result, POST), result.passedValidation());
 }