jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds-labs] [JCLOUDS-1010] use a lightweight image as a base for Docker build test (#208)
Date Wed, 21 Oct 2015 09:36:47 GMT
>     public void testListImages() {
> -      assertNotNull(api().listImages());
> +      List<ImageSummary> listImages = api().listImages();
> +      assertNotNull(listImages);
> +
> +      ImageSummary taggedImage = Iterables.find(listImages, new Predicate<ImageSummary>()
{
> +         @Override
> +         public boolean apply(ImageSummary input) {
> +            return input.repoTags().contains("jclouds:testTag");
> +         }
> +      });

The `find` method will throw an exception if not found, so the assertion below is redundant.
Use `tryFind` if you want to be explicit or just remove the assertion.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/208/files#r42602255
Mime
View raw message