// Path: src/main/java/com/cloudera/director/spi/v2/model/ConfigurationProperty.java
// public interface ConfigurationProperty extends Property<ConfigurationProperty.Widget> {
// 
//   /**
//    * Represents the widget used to display and edit a configuration property.
//    */
//   enum Widget {
// 
//     /**
//      * Radio button widget.
//      */
//     RADIO,
// 
//     /**
//      * Checkbox widget.
//      */
//     CHECKBOX,
// 
//     /**
//      * Text box widget.
//      */
//     TEXT,
// 
//     /**
//      * Password widget.
//      */
//     PASSWORD,
// 
//     /**
//      * Numeric widget.
//      */
//     NUMBER,
// 
//     /**
//      * Text area widget.
//      */
//     TEXTAREA,
// 
//     /**
//      * File upload widget.
//      */
//     FILE,
// 
//     /**
//      * List widget with fixed set of values.
//      */
//     LIST,
// 
//     /**
//      * List widget that supports typing additional values.
//      */
//     OPENLIST,
// 
//     /**
//      * Multiple selection widget for a fixed set of values.
//      */
//     MULTI,
// 
//     /**
//      * Multiple selection widget that supports typing additional values.
//      */
//     OPENMULTI
//   }
// 
//   /**
//    * Represents an attribute of a configuration property that can be localized.
//    */
//   enum ConfigurationPropertyLocalizableAttribute implements LocalizableAttribute {
// 
//     /**
//      * Missing value error message attribute.
//      */
//     MISSING_VALUE_ERROR_MESSAGE("missingValueErrorMessage"),
// 
//     /**
//      * Placeholder message attribute.
//      */
//     PLACEHOLDER("placeholder"),
// 
//     /**
//      * Valid values message attribute.
//      */
//     VALID_VALUES("validValues");
// 
//     /**
//      * The key component, used in building a localization key.
//      */
//     private final String keyComponent;
// 
//     /**
//      * Creates a localizable attribute with the specified parameters.
//      *
//      * @param keyComponent the key component, used in building a localization key
//      */
//     private ConfigurationPropertyLocalizableAttribute(String keyComponent) {
//       this.keyComponent = keyComponent;
//     }
// 
//     /**
//      * Returns the key component, used in building a localization key.
//      *
//      * @return the key component, used in building a localization key
//      */
//     public String getKeyComponent() {
//       return keyComponent;
//     }
//   }
// 
//   /**
//    * Returns the configuration key.
//    *
//    * @return the configuration key
//    */
//   String getConfigKey();
// 
//   /**
//    * Returns whether the configuration property is required.
//    *
//    * @return whether the configuration property is required
//    */
//   boolean isRequired();
// 
//   /**
//    * Returns the default value of the configuration property.
//    *
//    * @return the default value of the configuration property
//    */
//   String getDefaultValue();
// 
//   /**
//    * Returns the human-readable placeholder message when no value has been set for a
//    * configuration property.
// 
//    *
//    * @param localizationContext the localization context
//    * @return the human-readable placeholder message when no value has been set for a
//    * configuration property
//    */
//   String getPlaceholder(LocalizationContext localizationContext);
// 
//   /**
//    * Returns the localized human-readable error message for when a required configuration property
//    * is missing.
//    *
//    * @param localizationContext the localization context
//    * @return the localized human-readable error message for when a required configuration property
//    * is missing
//    */
//   String getMissingValueErrorMessage(LocalizationContext localizationContext);
// 
//   /**
//    * Returns a list of valid values for the configuration property with localized labels. Normally
//    * applies to properties that use LIST, OPENLIST, MULTI, or OPENMULTI widgets, but can apply to
//    * other widget types.
//    *
//    * @param localizationContext the localizationContext
//    * @return the valid values for the configuration property
//    */
//   List<ConfigurationPropertyValue> getValidValues(LocalizationContext localizationContext);
// }
// 
// Path: src/main/java/com/cloudera/director/spi/v2/model/ConfigurationPropertyToken.java
// public interface ConfigurationPropertyToken {
// 
//   /**
//    * Returns the configuration property.
//    *
//    * @return the configuration property
//    */
//   ConfigurationProperty unwrap();
// }
// 
// Path: src/main/java/com/cloudera/director/spi/v2/model/util/SimpleConfigurationPropertyBuilder.java
// public class SimpleConfigurationPropertyBuilder extends AbstractConfigurationPropertyBuilder
//     <SimpleConfigurationProperty, SimpleConfigurationPropertyBuilder> {
// 
//   @Override
//   public SimpleConfigurationPropertyBuilder getThis() {
//     return this;
//   }
// 
//   @Override
//   public SimpleConfigurationProperty build() {
//     return new SimpleConfigurationProperty(getConfigKey(), getType(), getName(), isRequired(),
//         getWidget(), getDefaultValue(), getDefaultDescription(), getDefaultErrorMessage(),
//         getValidValues(), isSensitive(), isHidden(), getDefaultPlaceholder());
//   }
// }


import static org.assertj.core.api.Assertions.assertThat;
import com.cloudera.director.spi.v2.model.ConfigurationProperty;
import com.cloudera.director.spi.v2.model.ConfigurationPropertyToken;
import com.cloudera.director.spi.v2.model.util.SimpleConfigurationPropertyBuilder;
import java.util.Arrays;
import java.util.List;
import org.assertj.core.util.Lists;
import org.junit.Test;
/*
 * Copyright (c) 2015 Cloudera, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.cloudera.director.spi.v2.util;





public class ConfigurationPropertiesUtilTest {

  @Test
  public void testAsConfigurationPropertyList() {
    final ConfigurationProperty config1 = makeConfigProperty("configKey1", "configDesc1");
    final ConfigurationProperty config2 = makeConfigProperty("configKey2", "configDesc2");
    List<ConfigurationProperty> configProperties = Arrays.asList(config1, config2);
// Path: src/main/java/com/cloudera/director/spi/v2/model/ConfigurationProperty.java
// public interface ConfigurationProperty extends Property<ConfigurationProperty.Widget> {
// 
//   /**
//    * Represents the widget used to display and edit a configuration property.
//    */
//   enum Widget {
// 
//     /**
//      * Radio button widget.
//      */
//     RADIO,
// 
//     /**
//      * Checkbox widget.
//      */
//     CHECKBOX,
// 
//     /**
//      * Text box widget.
//      */
//     TEXT,
// 
//     /**
//      * Password widget.
//      */
//     PASSWORD,
// 
//     /**
//      * Numeric widget.
//      */
//     NUMBER,
// 
//     /**
//      * Text area widget.
//      */
//     TEXTAREA,
// 
//     /**
//      * File upload widget.
//      */
//     FILE,
// 
//     /**
//      * List widget with fixed set of values.
//      */
//     LIST,
// 
//     /**
//      * List widget that supports typing additional values.
//      */
//     OPENLIST,
// 
//     /**
//      * Multiple selection widget for a fixed set of values.
//      */
//     MULTI,
// 
//     /**
//      * Multiple selection widget that supports typing additional values.
//      */
//     OPENMULTI
//   }
// 
//   /**
//    * Represents an attribute of a configuration property that can be localized.
//    */
//   enum ConfigurationPropertyLocalizableAttribute implements LocalizableAttribute {
// 
//     /**
//      * Missing value error message attribute.
//      */
//     MISSING_VALUE_ERROR_MESSAGE("missingValueErrorMessage"),
// 
//     /**
//      * Placeholder message attribute.
//      */
//     PLACEHOLDER("placeholder"),
// 
//     /**
//      * Valid values message attribute.
//      */
//     VALID_VALUES("validValues");
// 
//     /**
//      * The key component, used in building a localization key.
//      */
//     private final String keyComponent;
// 
//     /**
//      * Creates a localizable attribute with the specified parameters.
//      *
//      * @param keyComponent the key component, used in building a localization key
//      */
//     private ConfigurationPropertyLocalizableAttribute(String keyComponent) {
//       this.keyComponent = keyComponent;
//     }
// 
//     /**
//      * Returns the key component, used in building a localization key.
//      *
//      * @return the key component, used in building a localization key
//      */
//     public String getKeyComponent() {
//       return keyComponent;
//     }
//   }
// 
//   /**
//    * Returns the configuration key.
//    *
//    * @return the configuration key
//    */
//   String getConfigKey();
// 
//   /**
//    * Returns whether the configuration property is required.
//    *
//    * @return whether the configuration property is required
//    */
//   boolean isRequired();
// 
//   /**
//    * Returns the default value of the configuration property.
//    *
//    * @return the default value of the configuration property
//    */
//   String getDefaultValue();
// 
//   /**
//    * Returns the human-readable placeholder message when no value has been set for a
//    * configuration property.
// 
//    *
//    * @param localizationContext the localization context
//    * @return the human-readable placeholder message when no value has been set for a
//    * configuration property
//    */
//   String getPlaceholder(LocalizationContext localizationContext);
// 
//   /**
//    * Returns the localized human-readable error message for when a required configuration property
//    * is missing.
//    *
//    * @param localizationContext the localization context
//    * @return the localized human-readable error message for when a required configuration property
//    * is missing
//    */
//   String getMissingValueErrorMessage(LocalizationContext localizationContext);
// 
//   /**
//    * Returns a list of valid values for the configuration property with localized labels. Normally
//    * applies to properties that use LIST, OPENLIST, MULTI, or OPENMULTI widgets, but can apply to
//    * other widget types.
//    *
//    * @param localizationContext the localizationContext
//    * @return the valid values for the configuration property
//    */
//   List<ConfigurationPropertyValue> getValidValues(LocalizationContext localizationContext);
// }
// 
// Path: src/main/java/com/cloudera/director/spi/v2/model/ConfigurationPropertyToken.java
// public interface ConfigurationPropertyToken {
// 
//   /**
//    * Returns the configuration property.
//    *
//    * @return the configuration property
//    */
//   ConfigurationProperty unwrap();
// }
// 
// Path: src/main/java/com/cloudera/director/spi/v2/model/util/SimpleConfigurationPropertyBuilder.java
// public class SimpleConfigurationPropertyBuilder extends AbstractConfigurationPropertyBuilder
//     <SimpleConfigurationProperty, SimpleConfigurationPropertyBuilder> {
// 
//   @Override
//   public SimpleConfigurationPropertyBuilder getThis() {
//     return this;
//   }
// 
//   @Override
//   public SimpleConfigurationProperty build() {
//     return new SimpleConfigurationProperty(getConfigKey(), getType(), getName(), isRequired(),
//         getWidget(), getDefaultValue(), getDefaultDescription(), getDefaultErrorMessage(),
//         getValidValues(), isSensitive(), isHidden(), getDefaultPlaceholder());
//   }
// }


// Path: src/test/java/com/cloudera/director/spi/v2/util/ConfigurationPropertiesUtilTest.java
import static org.assertj.core.api.Assertions.assertThat;
import com.cloudera.director.spi.v2.model.ConfigurationProperty;
import com.cloudera.director.spi.v2.model.ConfigurationPropertyToken;
import com.cloudera.director.spi.v2.model.util.SimpleConfigurationPropertyBuilder;
import java.util.Arrays;
import java.util.List;
import org.assertj.core.util.Lists;
import org.junit.Test;

/*
 * Copyright (c) 2015 Cloudera, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.cloudera.director.spi.v2.util;





public class ConfigurationPropertiesUtilTest {

  @Test
  public void testAsConfigurationPropertyList() {
    final ConfigurationProperty config1 = makeConfigProperty("configKey1", "configDesc1");
    final ConfigurationProperty config2 = makeConfigProperty("configKey2", "configDesc2");
    List<ConfigurationProperty> configProperties = Arrays.asList(config1, config2);
    List<ConfigurationPropertyToken> configurationPropertyTokens = Arrays.asList(