@Test
public void testCreateBlueprint() throws Exception {

  Map<String, Object> props = BlueprintResourceProviderTest.getBlueprintTestProperties().iterator().next();
  replay(stack, dao, entity, configEntity);
  Blueprint blueprint = testFactory.createBlueprint(props, null);
  assertEquals(BLUEPRINT_NAME, blueprint.getName());
  assertSame(stack, blueprint.getStack());
  assertEquals(2, blueprint.getHostGroups().size());
  Map<String, HostGroup> hostGroups = blueprint.getHostGroups();
  HostGroup group1 = hostGroups.get("group1");
  assertEquals("group1", group1.getName());
  assertEquals("1", group1.getCardinality());
  Collection<String> components = group1.getComponentNames();
  assertEquals(2, components.size());
  assertTrue(components.contains("component1"));
  assertTrue(components.contains("component2"));
  Collection<String> services = group1.getServices();
  assertEquals(2, services.size());
  assertTrue(services.contains("test-service1"));
  assertTrue(services.contains("test-service2"));
  assertTrue(group1.containsMasterComponent());
  //todo: add configurations/attributes to properties
  Configuration configuration = group1.getConfiguration();
  assertTrue(configuration.getProperties().isEmpty());
  assertTrue(configuration.getAttributes().isEmpty());
  HostGroup group2 = hostGroups.get("group2");
  assertEquals("group2", group2.getName());
  assertEquals("2", group2.getCardinality());
  components = group2.getComponentNames();
  assertEquals(1, components.size());
  assertTrue(components.contains("component1"));
  services = group2.getServices();
  assertEquals(1, services.size());
  assertTrue(services.contains("test-service1"));
  assertTrue(group2.containsMasterComponent());
  //todo: add configurations/attributes to properties
  //todo: test both v1 and v2 config syntax
  configuration = group2.getConfiguration();
  assertTrue(configuration.getProperties().isEmpty());
  assertTrue(configuration.getAttributes().isEmpty());
  verify(dao, entity, configEntity);
}