ProvisionClusterRequest extends BaseClusterRequest { @Override public List<TopologyValidator> getTopologyValidators() { return topologyValidators; } ProvisionClusterRequest(Map<String, Object> properties, SecurityConfiguration securityConfiguration); Map<String, Credential> getCredentialsMap(); String getClusterName(); void setClusterName(String clusterName); ConfigRecommendationStrategy getConfigRecommendationStrategy(); @Override Long getClusterId(); void setClusterId(Long clusterId); @Override Type getType(); @Override List<TopologyValidator> getTopologyValidators(); @Override String getDescription(); String getRepositoryVersion(); String getQuickLinksProfileJson(); static final String HOSTGROUPS_PROPERTY; static final String HOSTGROUP_NAME_PROPERTY; static final String HOSTGROUP_HOST_COUNT_PROPERTY; static final String HOSTGROUP_HOST_PREDICATE_PROPERTY; static final String HOSTGROUP_HOST_FQDN_PROPERTY; static final String HOSTGROUP_HOST_RACK_INFO_PROPERTY; static final String HOSTGROUP_HOSTS_PROPERTY; static final String CONFIGURATIONS_PROPERTY; static final String DEFAULT_PASSWORD_PROPERTY; static final String CONFIG_RECOMMENDATION_STRATEGY; static final String REPO_VERSION_PROPERTY; static final String QUICKLINKS_PROFILE_FILTERS_PROPERTY; static final String QUICKLINKS_PROFILE_SERVICES_PROPERTY; }
@Test public void testGetValidators_noDefaultPassword() throws Exception { Map<String, Object> properties = createBlueprintRequestProperties(CLUSTER_NAME, BLUEPRINT_NAME); TopologyRequest request = new ProvisionClusterRequest(properties, null); List<TopologyValidator> validators = request.getTopologyValidators(); assertEquals(2, validators.size()); TopologyValidator pwdValidator = validators.get(0); TopologyValidator noDefaultPwdValidator = new RequiredPasswordValidator(null); assertEquals(pwdValidator, noDefaultPwdValidator); }
@Test public void testGetValidators_defaultPassword() throws Exception { Map<String, Object> properties = createBlueprintRequestProperties(CLUSTER_NAME, BLUEPRINT_NAME); properties.put("default_password", "pwd"); TopologyRequest request = new ProvisionClusterRequest(properties, null); List<TopologyValidator> validators = request.getTopologyValidators(); assertEquals(2, validators.size()); TopologyValidator pwdValidator = validators.get(0); TopologyValidator defaultPwdValidator = new RequiredPasswordValidator("pwd"); assertEquals(pwdValidator, defaultPwdValidator); }