assertThat(t2.getMinNumberOfInstances(), is(2));
}
@Test(expected = NumberFormatException.class)
public void testNumberFormatExceptionOnInstancesTemplates() throws Exception {
Configuration conf = new PropertiesConfiguration();
conf.addProperty("whirr.instance-templates", "1 hadoop-namenode+hadoop-jobtracker,3 hadoop-datanode+hadoop-tasktracker");
conf.addProperty("whirr.instance-templates-max-percent-failures", "60% hadoop-datanode+hadoop-tasktracker");
ClusterSpec expectedClusterSpec = ClusterSpec.withNoDefaults(conf);
List<InstanceTemplate> templates = expectedClusterSpec.getInstanceTemplates();
InstanceTemplate t1 = templates.get(0);
assertThat(t1.getMinNumberOfInstances(), is(1));
InstanceTemplate t2 = templates.get(1);