/** * This method tests the blank values for various parameters */ @Test public void testCreateEmrClusterBlankParams() throws Exception { // Create the namespace entity. NamespaceEntity namespaceEntity = namespaceDaoTestHelper.createNamespaceEntity(NAMESPACE); String configXml = IOUtils.toString(resourceLoader.getResource(EMR_CLUSTER_DEFINITION_XML_FILE_WITH_CLASSPATH).getInputStream()); EmrClusterDefinition emrClusterDefinition = xmlHelper.unmarshallXmlToObject(EmrClusterDefinition.class, configXml); List<ScriptDefinition> scriptDefinitions = emrClusterDefinition.getCustomBootstrapActionAll(); scriptDefinitions.get(0).setScriptArguments(null); emrClusterDefinition.setCustomBootstrapActionAll(scriptDefinitions); scriptDefinitions = emrClusterDefinition.getCustomBootstrapActionMaster(); scriptDefinitions.get(0).setScriptArguments(null); emrClusterDefinition.setCustomBootstrapActionMaster(scriptDefinitions); emrClusterDefinition.setVisibleToAll(null); emrClusterDefinition.setServiceIamRole(null); emrClusterDefinition.setAmiVersion(null); emrClusterDefinition.setServiceIamRole(emrClusterDefinition.getEc2NodeIamProfileName()); emrClusterDefinition.setScaleDownBehavior(null); emrClusterDefinition.setKerberosAttributes(null); configXml = xmlHelper.objectToXml(emrClusterDefinition); emrClusterDefinitionDaoTestHelper.createEmrClusterDefinitionEntity(namespaceEntity, EMR_CLUSTER_DEFINITION_NAME, configXml); // Create a new EMR cluster create request EmrClusterCreateRequest request = getNewEmrClusterCreateRequest(); emrService.createCluster(request); }
emrClusterDefinitionOverride.setConfigurations(Collections.<EmrClusterDefinitionConfiguration>emptyList()); expectedEmrClusterDefinition.setConfigurations(emrClusterDefinitionOverride.getConfigurations()); emrClusterDefinitionOverride.setCustomBootstrapActionAll(Collections.<ScriptDefinition>emptyList()); expectedEmrClusterDefinition.setCustomBootstrapActionAll(emrClusterDefinitionOverride.getCustomBootstrapActionAll()); emrClusterDefinitionOverride.setCustomBootstrapActionMaster(Collections.<ScriptDefinition>emptyList()); expectedEmrClusterDefinition.setCustomBootstrapActionMaster(emrClusterDefinitionOverride.getCustomBootstrapActionMaster());
keyValuePairConfigurations.getKeyValuePairConfigurations().add(new KeyValuePairConfiguration("keyValueShortcut", "attribKey", "attribVal")); emrClusterDefinition.setHadoopConfigurations(Arrays.asList(configurationFiles, keyValuePairConfigurations)); emrClusterDefinition.setCustomBootstrapActionAll(new ArrayList<>());
emrClusterDefinition.setCustomBootstrapActionAll(emrClusterDefinitionOverride.getCustomBootstrapActionAll());
emrClusterDefinition.setCustomBootstrapActionAll(emrClusterDefinitionOverride.getCustomBootstrapActionAll());
copy.customBootstrapActionAll = null; if (copyCustomBootstrapActionAll!= null) { copy.setCustomBootstrapActionAll(copyCustomBootstrapActionAll);
copy.customBootstrapActionAll = null; if (copyCustomBootstrapActionAll!= null) { copy.setCustomBootstrapActionAll(copyCustomBootstrapActionAll);
copy.customBootstrapActionAll = null; if (copyCustomBootstrapActionAll!= null) { copy.setCustomBootstrapActionAll(copyCustomBootstrapActionAll);