@Test public void shouldValidateTierWithValidTierDto() throws Exception { TierDto tierDto = new TierDto(); tierDto.setName("name"); tierDto.setFlavour("flavour"); tierDto.setImage("image"); tierDto.setInitialNumberInstances(new Integer(1)); tierDto.setMaximumNumberInstances(new Integer(4)); tierDto.setMinimumNumberInstances(new Integer(1)); environmentInstanceResourceValidator.validateTier(tierDto); assertTrue(true); }
public void validateTier(TierDto tierDto) throws InvalidEntityException { if (tierDto.getMaximumNumberInstances() == null) { throw new InvalidEntityException("Maximum Number Instances " + "from tierDto is null"); } if (tierDto.getMinimumNumberInstances() == null) { throw new InvalidEntityException("Minimum Number Instances " + "from tierDto is null"); } if (tierDto.getInitialNumberInstances() == null) { throw new InvalidEntityException("Initial Number Instances " + "from tierDto is null"); } if (tierDto.getName() == null) { throw new InvalidEntityException("Tier Name " + "from tierDto is null"); } if (tierDto.getImage() == null) { throw new InvalidEntityException("Tier Image " + "from tierDto is null"); } if (tierDto.getFlavour() == null) { throw new InvalidEntityException("Tier Flavour " + "from tierDto is null"); } }
EnvironmentInstanceResourceValidatorImpl implements EnvironmentInstanceResourceValidator { public void validateTier(TierDto tierDto) throws InvalidEntityException { if (tierDto.getMaximumNumberInstances() == null) { throw new InvalidEntityException("Maximum Number Instances " + "from tierDto is null"); } if (tierDto.getMinimumNumberInstances() == null) { throw new InvalidEntityException("Minimum Number Instances " + "from tierDto is null"); } if (tierDto.getInitialNumberInstances() == null) { throw new InvalidEntityException("Initial Number Instances " + "from tierDto is null"); } if (tierDto.getName() == null) { throw new InvalidEntityException("Tier Name " + "from tierDto is null"); } if (tierDto.getImage() == null) { throw new InvalidEntityException("Tier Image " + "from tierDto is null"); } if (tierDto.getFlavour() == null) { throw new InvalidEntityException("Tier Flavour " + "from tierDto is null"); } } }
EnvironmentInstanceResourceValidatorImpl implements EnvironmentInstanceResourceValidator { public void validateTier(TierDto tierDto) throws InvalidEntityException { if (tierDto.getMaximumNumberInstances() == null) { throw new InvalidEntityException("Maximum Number Instances " + "from tierDto is null"); } if (tierDto.getMinimumNumberInstances() == null) { throw new InvalidEntityException("Minimum Number Instances " + "from tierDto is null"); } if (tierDto.getInitialNumberInstances() == null) { throw new InvalidEntityException("Initial Number Instances " + "from tierDto is null"); } if (tierDto.getName() == null) { throw new InvalidEntityException("Tier Name " + "from tierDto is null"); } if (tierDto.getImage() == null) { throw new InvalidEntityException("Tier Image " + "from tierDto is null"); } if (tierDto.getFlavour() == null) { throw new InvalidEntityException("Tier Flavour " + "from tierDto is null"); } }  }
EnvironmentInstanceResourceValidatorImpl implements EnvironmentInstanceResourceValidator { public void validateTier(TierDto tierDto) throws InvalidEntityException { if (tierDto.getMaximumNumberInstances() == null) { throw new InvalidEntityException("Maximum Number Instances " + "from tierDto is null"); } if (tierDto.getMinimumNumberInstances() == null) { throw new InvalidEntityException("Minimum Number Instances " + "from tierDto is null"); } if (tierDto.getInitialNumberInstances() == null) { throw new InvalidEntityException("Initial Number Instances " + "from tierDto is null"); } if (tierDto.getName() == null) { throw new InvalidEntityException("Tier Name " + "from tierDto is null"); } if (tierDto.getImage() == null) { throw new InvalidEntityException("Tier Image " + "from tierDto is null"); } if (tierDto.getFlavour() == null) { throw new InvalidEntityException("Tier Flavour " + "from tierDto is null"); } }  void validateCreate(EnvironmentInstanceDto environmentInstanceDto,
            SystemPropertiesProvider systemPropertiesProvider, ClaudiaData claudiaData); void validateTier(TierDto tierDto); void validateQuota(ClaudiaData claudiaData, EnvironmentInstanceDto environmentInstanceDto); void setEnvironmentInstanceDao(EnvironmentInstanceDao environmentInstanceDao); void setTierResourceValidator(TierResourceValidator tierResourceValidator); QuotaClient getQuotaClient(); void setQuotaClient(QuotaClient quotaClient); void setResourceValidator(ResourceValidator resourceValidator); }
EnvironmentInstanceResourceValidatorImpl implements EnvironmentInstanceResourceValidator { public void validateTier(TierDto tierDto) throws InvalidEntityException { if (tierDto.getMaximumNumberInstances() == null) { throw new InvalidEntityException("Maximum Number Instances " + "from tierDto is null"); } if (tierDto.getMinimumNumberInstances() == null) { throw new InvalidEntityException("Minimum Number Instances " + "from tierDto is null"); } if (tierDto.getInitialNumberInstances() == null) { throw new InvalidEntityException("Initial Number Instances " + "from tierDto is null"); } if (tierDto.getName() == null) { throw new InvalidEntityException("Tier Name " + "from tierDto is null"); } if (tierDto.getImage() == null) { throw new InvalidEntityException("Tier Image " + "from tierDto is null"); } if (tierDto.getFlavour() == null) { throw new InvalidEntityException("Tier Flavour " + "from tierDto is null"); } }  void validateCreate(EnvironmentInstanceDto environmentInstanceDto,
            SystemPropertiesProvider systemPropertiesProvider, ClaudiaData claudiaData); void validateTier(TierDto tierDto); void validateQuota(ClaudiaData claudiaData, EnvironmentInstanceDto environmentInstanceDto); void setEnvironmentInstanceDao(EnvironmentInstanceDao environmentInstanceDao); void setTierResourceValidator(TierResourceValidator tierResourceValidator); QuotaClient getQuotaClient(); void setQuotaClient(QuotaClient quotaClient); void setResourceValidator(ResourceValidator resourceValidator);  }