> + };
> +
> + final GetImageStrategy getImageStrategy =
> createMock(GetImageStrategy.class);
> +
> + expect(getImageStrategy.getImage(image.getId())).andReturn(image);
> + replay(getImageStrategy);
> +
> + Provider<TemplateBuilder> templateBuilderProvider = new
> Provider<TemplateBuilder>() {
> + @Override
> + public TemplateBuilder get() {
> + return createTemplateBuilder(null, locations, images, hardwares,
> region, optionsProvider, this, getImageStrategy);
> + }
> + };
> +
> + // Note that the image provided is not in the image list, but it is
> the one returned by the GetImagestrategy
> + TemplateBuilder templateBuilder =
> templateBuilderProvider.get().imageId(image.getId());
One of the arguments to create the template builder is a template builder
provider (note the *this* parameter). That's why the provider is used instead
of directly creating it.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/396/files#r13599356