> +      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());
> +      Template template = templateBuilder.build();
> +
> +      assertEquals(template.getImage().getId(), image.getId());
> +      verify(getImageStrategy);

Yep, we want to check the exact number of calls, at least for the moment. See 
comment below about the WIP pull request: there is a test that validates that 
images have properly been registered in the image cache and we need to make 
sure the strategy is not being called again.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/396/files#r13599490

Reply via email to