diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/compute/strategy/EC2PopulateDefaultLoginCredentialsForImageStrategy.java b/apis/ec2/src/main/java/org/jclouds/ec2/compute/strategy/EC2PopulateDefaultLoginCredentialsForImageStrategy.java index 0003d4f5a0..9ca3604366 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/compute/strategy/EC2PopulateDefaultLoginCredentialsForImageStrategy.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/compute/strategy/EC2PopulateDefaultLoginCredentialsForImageStrategy.java @@ -20,28 +20,34 @@ package org.jclouds.ec2.compute.strategy; import static com.google.common.base.Preconditions.checkArgument; +import java.util.Map; + import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; import org.jclouds.compute.strategy.impl.ReturnCredentialsBoundToImage; +import org.jclouds.domain.Credentials; import org.jclouds.domain.LoginCredentials; import org.jclouds.domain.LoginCredentials.Builder; import org.jclouds.ec2.domain.Image; import org.jclouds.javax.annotation.Nullable; +import com.google.common.collect.ImmutableMap; + /** * @author Oleksiy Yarmula */ @Singleton public class EC2PopulateDefaultLoginCredentialsForImageStrategy extends ReturnCredentialsBoundToImage { public EC2PopulateDefaultLoginCredentialsForImageStrategy() { - this(null); + this(null, ImmutableMap. of()); } @Inject - public EC2PopulateDefaultLoginCredentialsForImageStrategy(@Nullable @Named("image") LoginCredentials creds) { - super(creds); + public EC2PopulateDefaultLoginCredentialsForImageStrategy(@Nullable @Named("image") LoginCredentials creds, + Map credentialStore) { + super(creds, credentialStore); } @Override diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/EC2ImageParserTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/EC2ImageParserTest.java index 966cc17f82..54dafaa650 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/EC2ImageParserTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/EC2ImageParserTest.java @@ -83,7 +83,7 @@ public class EC2ImageParserTest { .getInstance(Json.class)); Set result = DescribeImagesResponseHandlerTest.parseImages(resource); - EC2ImageParser parser = new EC2ImageParser(new EC2PopulateDefaultLoginCredentialsForImageStrategy(null), map, + EC2ImageParser parser = new EC2ImageParser(new EC2PopulateDefaultLoginCredentialsForImageStrategy(), map, Suppliers.> ofInstance(ImmutableSet. of(defaultLocation)), Suppliers .ofInstance(defaultLocation), new ReviseParsedImage.NoopReviseParsedImage()); return Sets.newLinkedHashSet(Iterables.filter(Iterables.transform(result, parser), Predicates.notNull())); diff --git a/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/compute/strategy/ParseVAppTemplateDescriptionToGetDefaultLoginCredentials.java b/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/compute/strategy/ParseVAppTemplateDescriptionToGetDefaultLoginCredentials.java index 2dda033169..d7fe61d4ba 100644 --- a/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/compute/strategy/ParseVAppTemplateDescriptionToGetDefaultLoginCredentials.java +++ b/common/trmk/src/main/java/org/jclouds/trmk/vcloud_0_8/compute/strategy/ParseVAppTemplateDescriptionToGetDefaultLoginCredentials.java @@ -21,6 +21,7 @@ package org.jclouds.trmk.vcloud_0_8.compute.strategy; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -31,6 +32,7 @@ import javax.inject.Singleton; import org.jclouds.compute.reference.ComputeServiceConstants; import org.jclouds.compute.strategy.impl.ReturnCredentialsBoundToImage; +import org.jclouds.domain.Credentials; import org.jclouds.domain.LoginCredentials; import org.jclouds.javax.annotation.Nullable; import org.jclouds.logging.Logger; @@ -42,8 +44,9 @@ import org.jclouds.trmk.vcloud_0_8.domain.VAppTemplate; @Singleton public class ParseVAppTemplateDescriptionToGetDefaultLoginCredentials extends ReturnCredentialsBoundToImage { @Inject - public ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(@Nullable @Named("image") LoginCredentials creds) { - super(creds); + public ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(@Nullable @Named("image") LoginCredentials creds, + Map credentialStore) { + super(creds, credentialStore); } @Resource diff --git a/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/compute/strategy/PopulateDefaultLoginCredentialsForVAppTemplateTest.java b/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/compute/strategy/PopulateDefaultLoginCredentialsForVAppTemplateTest.java index b3c27d0e8d..97003be038 100644 --- a/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/compute/strategy/PopulateDefaultLoginCredentialsForVAppTemplateTest.java +++ b/common/trmk/src/test/java/org/jclouds/trmk/vcloud_0_8/compute/strategy/PopulateDefaultLoginCredentialsForVAppTemplateTest.java @@ -32,6 +32,7 @@ import org.jclouds.trmk.vcloud_0_8.compute.strategy.ParseVAppTemplateDescription import org.jclouds.trmk.vcloud_0_8.domain.VAppTemplate; import org.testng.annotations.Test; +import com.google.common.collect.ImmutableMap; import com.google.common.io.ByteStreams; /** @@ -47,7 +48,8 @@ public class PopulateDefaultLoginCredentialsForVAppTemplateTest { VAppTemplate template = createMock(VAppTemplate.class); expect(template.getDescription()).andReturn(description).atLeastOnce(); replay(template); - ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(null); + ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials( + null, ImmutableMap. of()); Credentials creds = converter.execute(template); assertEquals(creds.identity, "vcloud"); assertEquals(creds.credential, "$Ep455l0ud!2"); @@ -61,7 +63,8 @@ public class PopulateDefaultLoginCredentialsForVAppTemplateTest { VAppTemplate template = createMock(VAppTemplate.class); expect(template.getDescription()).andReturn(description).atLeastOnce(); replay(template); - ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(null); + ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials( + null, ImmutableMap. of()); Credentials creds = converter.execute(template); assertEquals(creds.identity, "ecloud"); assertEquals(creds.credential, "$Ep455l0ud!2"); @@ -75,7 +78,8 @@ public class PopulateDefaultLoginCredentialsForVAppTemplateTest { VAppTemplate template = createMock(VAppTemplate.class); expect(template.getDescription()).andReturn(description).atLeastOnce(); replay(template); - ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(null); + ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials( + null, ImmutableMap. of()); Credentials creds = converter.execute(template); assertEquals(creds.identity, "vpncubed"); assertEquals(creds.credential, "vpncubed"); @@ -89,7 +93,8 @@ public class PopulateDefaultLoginCredentialsForVAppTemplateTest { VAppTemplate template = createMock(VAppTemplate.class); expect(template.getDescription()).andReturn(description).atLeastOnce(); replay(template); - ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(null); + ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials( + null, ImmutableMap. of()); Credentials creds = converter.execute(template); assertEquals(creds.identity, "ecloud"); assertEquals(creds.credential, "TmrkCl0ud1s#1!"); @@ -103,7 +108,8 @@ public class PopulateDefaultLoginCredentialsForVAppTemplateTest { VAppTemplate template = createMock(VAppTemplate.class); expect(template.getDescription()).andReturn(description).atLeastOnce(); replay(template); - ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials(null); + ParseVAppTemplateDescriptionToGetDefaultLoginCredentials converter = new ParseVAppTemplateDescriptionToGetDefaultLoginCredentials( + null, ImmutableMap. of()); Credentials creds = converter.execute(template); assertEquals(creds.identity, "Administrator"); assertEquals(creds.credential, null); diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/strategy/AWSEC2ImageParserTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/strategy/AWSEC2ImageParserTest.java index 3355bbaaca..7e2498a842 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/strategy/AWSEC2ImageParserTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/strategy/AWSEC2ImageParserTest.java @@ -192,7 +192,7 @@ public class AWSEC2ImageParserTest { .getInstance(Json.class)); Set result = DescribeImagesResponseHandlerTest.parseImages(resource); - EC2ImageParser parser = new EC2ImageParser(new EC2PopulateDefaultLoginCredentialsForImageStrategy(null), map, + EC2ImageParser parser = new EC2ImageParser(new EC2PopulateDefaultLoginCredentialsForImageStrategy(), map, Suppliers.> ofInstance(ImmutableSet. of(defaultLocation)), Suppliers.ofInstance(defaultLocation), new AWSEC2ReviseParsedImage(map)); return Sets.newLinkedHashSet(Iterables.filter(Iterables.transform(result, parser), Predicates.notNull())); diff --git a/providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/compute/strategy/EucalyptusPartnerCloudReviseParsedImageTest.java b/providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/compute/strategy/EucalyptusPartnerCloudReviseParsedImageTest.java index 5b045f4f9b..be7dc10a7b 100644 --- a/providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/compute/strategy/EucalyptusPartnerCloudReviseParsedImageTest.java +++ b/providers/eucalyptus-partnercloud-ec2/src/test/java/org/jclouds/epc/compute/strategy/EucalyptusPartnerCloudReviseParsedImageTest.java @@ -120,7 +120,7 @@ public class EucalyptusPartnerCloudReviseParsedImageTest { .getInstance(Json.class)); Set result = DescribeImagesResponseHandlerTest.parseImages(resource); - EC2ImageParser parser = new EC2ImageParser(new EC2PopulateDefaultLoginCredentialsForImageStrategy(null), map, + EC2ImageParser parser = new EC2ImageParser(new EC2PopulateDefaultLoginCredentialsForImageStrategy(), map, Suppliers.> ofInstance(ImmutableSet. of(defaultLocation)), Suppliers .ofInstance(defaultLocation), new EucalyptusPartnerCloudReviseParsedImage(map)); return Sets.newLinkedHashSet(Iterables.filter(Iterables.transform(result, parser), Predicates.notNull()));