Search in sources :

Example 11 with ConfigurationOptionSetting

use of com.amazonaws.services.elasticbeanstalk.model.ConfigurationOptionSetting in project Synapse-Stack-Builder by Sage-Bionetworks.

the class ElasticBeanstalkSetupTest method testMinAutoScaleSizeProductionPortal.

@Test
public void testMinAutoScaleSizeProductionPortal() throws IOException {
    List<ConfigurationOptionSetting> expected = new LinkedList<ConfigurationOptionSetting>();
    // For prod the min should be 2
    config = TestHelper.createTestConfig("prod");
    resources = TestHelper.createTestResources(config);
    setup = new ElasticBeanstalkSetup(factory, config, resources);
    // From the server tab
    expected.add(new ConfigurationOptionSetting().withNamespace("aws:autoscaling:asg").withOptionName("MinSize").withValue("4"));
    List<ConfigurationOptionSetting> result = setup.getAllElasticBeanstalkOptions(StackEnvironmentType.PORTAL);
    // Make sure we can find all of the expected values
    for (ConfigurationOptionSetting expectedCon : expected) {
        ConfigurationOptionSetting found = find(expectedCon.getNamespace(), expectedCon.getOptionName(), result);
        assertNotNull("Failed to find expected configuration: " + expectedCon, found);
        assertEquals("Values did not match for namespace: " + expectedCon.getNamespace() + " and option name: " + expectedCon.getOptionName(), expectedCon.getValue(), found.getValue());
    }
}
Also used : ConfigurationOptionSetting(com.amazonaws.services.elasticbeanstalk.model.ConfigurationOptionSetting) LinkedList(java.util.LinkedList) Test(org.junit.Test)

Example 12 with ConfigurationOptionSetting

use of com.amazonaws.services.elasticbeanstalk.model.ConfigurationOptionSetting in project Synapse-Stack-Builder by Sage-Bionetworks.

the class ElasticBeanstalkSetupTest method testMinAutoScaleSizeProductionRepo.

@Test
public void testMinAutoScaleSizeProductionRepo() throws IOException {
    List<ConfigurationOptionSetting> expected = new LinkedList<ConfigurationOptionSetting>();
    // For prod the min should be 2
    config = TestHelper.createTestConfig("prod");
    resources = TestHelper.createTestResources(config);
    setup = new ElasticBeanstalkSetup(factory, config, resources);
    // From the server tab
    expected.add(new ConfigurationOptionSetting().withNamespace("aws:autoscaling:asg").withOptionName("MinSize").withValue("8"));
    List<ConfigurationOptionSetting> result = setup.getAllElasticBeanstalkOptions(StackEnvironmentType.REPO);
    // Make sure we can find all of the expected values
    for (ConfigurationOptionSetting expectedCon : expected) {
        ConfigurationOptionSetting found = find(expectedCon.getNamespace(), expectedCon.getOptionName(), result);
        assertNotNull("Failed to find expected configuration: " + expectedCon, found);
        assertEquals("Values did not match for namespace: " + expectedCon.getNamespace() + " and option name: " + expectedCon.getOptionName(), expectedCon.getValue(), found.getValue());
    }
}
Also used : ConfigurationOptionSetting(com.amazonaws.services.elasticbeanstalk.model.ConfigurationOptionSetting) LinkedList(java.util.LinkedList) Test(org.junit.Test)

Aggregations

ConfigurationOptionSetting (com.amazonaws.services.elasticbeanstalk.model.ConfigurationOptionSetting)12 Test (org.junit.Test)10 LinkedList (java.util.LinkedList)8 DescribeConfigurationOptionsRequest (com.amazonaws.services.elasticbeanstalk.model.DescribeConfigurationOptionsRequest)2 ArrayList (java.util.ArrayList)2 AmazonServiceException (com.amazonaws.AmazonServiceException)1 CreateConfigurationTemplateRequest (com.amazonaws.services.elasticbeanstalk.model.CreateConfigurationTemplateRequest)1 DescribeConfigurationOptionsResult (com.amazonaws.services.elasticbeanstalk.model.DescribeConfigurationOptionsResult)1 EnvironmentDescription (com.amazonaws.services.elasticbeanstalk.model.EnvironmentDescription)1 UpdateConfigurationTemplateRequest (com.amazonaws.services.elasticbeanstalk.model.UpdateConfigurationTemplateRequest)1 Properties (java.util.Properties)1 ExecutionException (java.util.concurrent.ExecutionException)1