Configuration conf = new PropertiesConfiguration();
conf.addProperty("whirr.provider", "aws-ec2");
conf.addProperty("whirr.version", "version-string");
conf.addProperty("whirr.instance-templates-max-percent-failure", "60 hadoop-datanode+hadoop-tasktracker");
ClusterSpec expectedClusterSpec = ClusterSpec.withTemporaryKeys(conf);
expectedClusterSpec.setInstanceTemplates(Lists.newArrayList(
InstanceTemplate.builder().numberOfInstance(1).minNumberOfInstances(1)
.roles("hadoop-namenode", "hadoop-jobtracker").build(),
InstanceTemplate.builder().numberOfInstance(3).minNumberOfInstances(2)
.roles("hadoop-datanode", "hadoop-tasktracker").build()
));
expectedClusterSpec.setServiceName("hadoop");
expectedClusterSpec.setIdentity("myusername");
expectedClusterSpec.setCredential("mypassword");
expectedClusterSpec.setClusterName("test-cluster");
expectedClusterSpec.setPrivateKey(keys.get("private"));
expectedClusterSpec.setPublicKey(keys.get("public"));
verify(factory).create("hadoop");
verify(controller).launchCluster(expectedClusterSpec);