"createNewPlacementGroupUnlessUserSpecifiedOtherwise", String.class, String.class,
TemplateOptions.class),
CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions.class.getDeclaredMethod(
"getSecurityGroupsForTagAndOptions", String.class, String.class, TemplateOptions.class) });
AWSEC2TemplateOptions options = createMock(AWSEC2TemplateOptions.class);
Template template = createMock(Template.class);
// setup expectations
expect(strategy.getOptionsProvider()).andReturn(OPTIONS_PROVIDER);
expect(template.getHardware()).andReturn(size).atLeastOnce();
expect(template.getOptions()).andReturn(options).atLeastOnce();
expect(options.getBlockDeviceMappings()).andReturn(ImmutableSet.<BlockDeviceMapping> of()).atLeastOnce();
expect(strategy.createNewKeyPairUnlessUserSpecifiedOtherwise(region, group, options)).andReturn(
systemGeneratedKeyPairName);
expect(strategy.getSecurityGroupsForTagAndOptions(region, group, options)).andReturn(generatedGroups);
expect(options.getGroupIds()).andReturn(ImmutableSet.<String> of());
expect(options.getSubnetId()).andReturn(null);
expect(options.getUserData()).andReturn("hello".getBytes());
expect(options.isMonitoringEnabled()).andReturn(false);
// replay mocks
replay(options);
replay(template);
replay(strategy);