@Test(expected=IllegalArgumentException.class) public void testCreate_HostGroupWithInvalidComponent() throws Exception { Map<String, Object> props = BlueprintResourceProviderTest.getBlueprintTestProperties().iterator().next(); ((Set<Map<String, Object>>) ((Set<Map<String, Object>>) props.get(BlueprintResourceProvider.HOST_GROUP_PROPERTY_ID)). iterator().next().get(BlueprintResourceProvider.COMPONENT_PROPERTY_ID)).iterator().next().put("name", "INVALID_COMPONENT"); replay(stack, dao, entity, configEntity); testFactory.createBlueprint(props, null); }
@SuppressWarnings("unchecked") public Blueprint createBlueprint(Map<String, Object> properties, SecurityConfiguration securityConfiguration) throws NoSuchStackException { String name = String.valueOf(properties.get(BLUEPRINT_NAME_PROPERTY_ID)); if (name.equals("null") || name.isEmpty()) { throw new IllegalArgumentException("Blueprint name must be provided"); } Stack stack = createStack(properties); Collection<HostGroup> hostGroups = processHostGroups(name, stack, properties); Configuration configuration = configFactory.getConfiguration((Collection<Map<String, String>>) properties.get(CONFIGURATION_PROPERTY_ID)); Setting setting = SettingFactory.getSetting((Collection<Map<String, Object>>) properties.get(SETTINGS_PROPERTY_ID)); return new BlueprintImpl(name, hostGroups, stack, configuration, securityConfiguration, setting); }
BlueprintFactory { @SuppressWarnings("unchecked") public Blueprint createBlueprint(Map<String, Object> properties, SecurityConfiguration securityConfiguration) throws NoSuchStackException { String name = String.valueOf(properties.get(BLUEPRINT_NAME_PROPERTY_ID)); if (name.equals("null") || name.isEmpty()) { throw new IllegalArgumentException("Blueprint name must be provided"); } Stack stack = createStack(properties); Collection<HostGroup> hostGroups = processHostGroups(name, stack, properties); Configuration configuration = configFactory.getConfiguration((Collection<Map<String, String>>) properties.get(CONFIGURATION_PROPERTY_ID)); Setting setting = SettingFactory.getSetting((Collection<Map<String, Object>>) properties.get(SETTINGS_PROPERTY_ID)); return new BlueprintImpl(name, hostGroups, stack, configuration, securityConfiguration, setting); } }
BlueprintFactory { @SuppressWarnings("unchecked") public Blueprint createBlueprint(Map<String, Object> properties, SecurityConfiguration securityConfiguration) throws NoSuchStackException { String name = String.valueOf(properties.get(BLUEPRINT_NAME_PROPERTY_ID)); if (name.equals("null") || name.isEmpty()) { throw new IllegalArgumentException("Blueprint name must be provided"); } Stack stack = createStack(properties); Collection<HostGroup> hostGroups = processHostGroups(name, stack, properties); Configuration configuration = configFactory.getConfiguration((Collection<Map<String, String>>) properties.get(CONFIGURATION_PROPERTY_ID)); Setting setting = SettingFactory.getSetting((Collection<Map<String, Object>>) properties.get(SETTINGS_PROPERTY_ID)); return new BlueprintImpl(name, hostGroups, stack, configuration, securityConfiguration, setting); } BlueprintFactory(); protected  BlueprintFactory(StackFactory stackFactory); }
BlueprintFactory { @SuppressWarnings("unchecked") public Blueprint createBlueprint(Map<String, Object> properties, SecurityConfiguration securityConfiguration) throws NoSuchStackException { String name = String.valueOf(properties.get(BLUEPRINT_NAME_PROPERTY_ID)); if (name.equals("null") || name.isEmpty()) { throw new IllegalArgumentException("Blueprint name must be provided"); } Stack stack = createStack(properties); Collection<HostGroup> hostGroups = processHostGroups(name, stack, properties); Configuration configuration = configFactory.getConfiguration((Collection<Map<String, String>>) properties.get(CONFIGURATION_PROPERTY_ID)); Setting setting = SettingFactory.getSetting((Collection<Map<String, Object>>) properties.get(SETTINGS_PROPERTY_ID)); return new BlueprintImpl(name, hostGroups, stack, configuration, securityConfiguration, setting); } BlueprintFactory(); protected  BlueprintFactory(StackFactory stackFactory); Blueprint getBlueprint(String blueprintName); @SuppressWarnings("unchecked") Blueprint createBlueprint(Map<String, Object> properties, SecurityConfiguration securityConfiguration); @Inject static void init(BlueprintDAO dao); }
BlueprintFactory { @SuppressWarnings("unchecked") public Blueprint createBlueprint(Map<String, Object> properties, SecurityConfiguration securityConfiguration) throws NoSuchStackException { String name = String.valueOf(properties.get(BLUEPRINT_NAME_PROPERTY_ID)); if (name.equals("null") || name.isEmpty()) { throw new IllegalArgumentException("Blueprint name must be provided"); } Stack stack = createStack(properties); Collection<HostGroup> hostGroups = processHostGroups(name, stack, properties); Configuration configuration = configFactory.getConfiguration((Collection<Map<String, String>>) properties.get(CONFIGURATION_PROPERTY_ID)); Setting setting = SettingFactory.getSetting((Collection<Map<String, Object>>) properties.get(SETTINGS_PROPERTY_ID)); return new BlueprintImpl(name, hostGroups, stack, configuration, securityConfiguration, setting); } BlueprintFactory(); protected  BlueprintFactory(StackFactory stackFactory); Blueprint getBlueprint(String blueprintName); @SuppressWarnings("unchecked") Blueprint createBlueprint(Map<String, Object> properties, SecurityConfiguration securityConfiguration); @Inject static void init(BlueprintDAO dao);  }