@Before
    public void setUpValidObject() {
      cTest = new ClusterValidator();

      cluster = new Cluster();
      cluster.setDescription("a-desc");
      cluster.setName("aName");
    }
    @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");
    }
Esempio n. 3
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;
  }
 @Test
 public void shouldRejectUtiliztation() {
   cluster.setUtilization("1%");
   ValidatorResult result = cTest.validate(cluster, POST);
   assertFalse(resultMessage(result, POST), result.passedValidation());
 }
 @Test
 public void shouldRejectUniqueCustomers() {
   cluster.setNumberOfUniqueCustomers(2);
   ValidatorResult result = cTest.validate(cluster, POST);
   assertFalse(resultMessage(result, POST), result.passedValidation());
 }
 @Test
 public void shouldRejectLbConfigs() {
   cluster.setNumberOfLoadBalancingConfigurations(2);
   ValidatorResult result = cTest.validate(cluster, POST);
   assertFalse(resultMessage(result, POST), result.passedValidation());
 }
 @Test
 public void shouldRejectNullDataCenter() {
   cluster.setDataCenter(null);
   ValidatorResult result = cTest.validate(cluster, POST);
   assertFalse(resultMessage(result, POST), result.passedValidation());
 }
 @Test
 public void shouldRejectHostMachines() {
   cluster.setNumberOfHostMachines(2);
   ValidatorResult result = cTest.validate(cluster, PUT);
   assertFalse(resultMessage(result, PUT), result.passedValidation());
 }