assertEquals("Error for empty resourceId", "Error", service.getResource(null, null, Product.ec2, null, null, 0));
assertEquals("Error for empty resourceId", "Error", service.getResource(null, null, Product.ec2, "", null, 0));
assertEquals("Unknown for resourceIds that we do not find", "Unknown", service.getResource(null, null, Product.ec2, "someunknowninstance", null, 0));
JSONArray instances = service.readInstanceArray();
String resource = service.getResource(null, null, Product.ec2, instances.getString(0), null, 0);
assertFalse("Not Error for an actual instance", "Error".equals(resource));
resource = service.getResource(null, null, Product.ec2_instance, instances.getString(0), null, 0);
assertFalse("Not Error for an actual instance", "Error".equals(resource));
for(int i = 0;i < instances.length();i++) {
resource = service.getResource(null, null, Product.ec2_instance, instances.getString(i), null, 0);
assertFalse("Not Error for an actual instance", "Error".equals(resource));
}
}