You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Noorul Islam K M <no...@github.com> on 2013/09/19 13:47:44 UTC

[jclouds-chef] Make listCookbooksInEnvironment return empty set of CookbookDefinition o... (#27)

...n 404.

Added tests to validate above. Also factored out some duplicate code in test.
You can merge this Pull Request by running:

  git pull https://github.com/noorul/jclouds-chef fix_return_on_404

Or you can view, comment on it, or merge it online at:

  https://github.com/jclouds/jclouds-chef/pull/27

-- Commit Summary --

  * Make listCookbooksInEnvironment return empty set of CookbookDefinition on 404.

-- File Changes --

    M core/src/main/java/org/jclouds/chef/ChefApi.java (11)
    M core/src/test/java/org/jclouds/chef/ChefApiExpectTest.java (81)

-- Patch Links --

https://github.com/jclouds/jclouds-chef/pull/27.patch
https://github.com/jclouds/jclouds-chef/pull/27.diff

Re: [jclouds-chef] Make listCookbooksInEnvironment return empty set of CookbookDefinition o... (#27)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-chef-pull-requests #69](https://jclouds.ci.cloudbees.com/job/jclouds-chef-pull-requests/69/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/27#issuecomment-24739674

Re: [jclouds-chef] Make listCookbooksInEnvironment return empty set of CookbookDefinition o... (#27)

Posted by Noorul Islam K M <no...@github.com>.
>        Set<String> nodes = api.listNodesInEnvironment("dev");
>        assertTrue(nodes.isEmpty(), String.format("Expected nodes to be empty but was: %s", nodes));
>     }
>  
> +   public void testListCookbooksInEnvironmentReturnsEmptySetOn404() {
> +      ChefApi api = requestSendsResponse(
> +            signed(getHttpRequestBuilder("GET", "/environments/dev/cookbooks").build()),
> +            HttpResponse.builder().statusCode(404).build());
> +      Set<CookbookDefinition> cookbooks = api.listCookbooksInEnvironment("dev");
> +      assertTrue(cookbooks.isEmpty(), String.format("Expected cookbooks to be empty but was: %s", cookbooks));
> +   }
> +
> +   public void testListCookbooksInEnvironmentWithNumVersionReturnsEmptySetOn404() {
> +      ChefApi api = requestSendsResponse(
> +            signed(getHttpRequestBuilder("GET", "/environments/dev/cookbooks?num_versions=2").build()),

Done!

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

Re: [jclouds-chef] Make listCookbooksInEnvironment return empty set of CookbookDefinition o... (#27)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-chef-pull-requests #64](https://jclouds.ci.cloudbees.com/job/jclouds-chef-pull-requests/64/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/27#issuecomment-24733546

Re: [jclouds-chef] Make listCookbooksInEnvironment return empty set of CookbookDefinition o... (#27)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-chef #414](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-chef/414/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/27#issuecomment-24733409

Re: [jclouds-chef] Make listCookbooksInEnvironment return empty set of CookbookDefinition o... (#27)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-chef-pull-requests #68](https://jclouds.ci.cloudbees.com/job/jclouds-chef-pull-requests/68/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/27#issuecomment-24739431

Re: [jclouds-chef] Make listCookbooksInEnvironment return empty set of CookbookDefinition o... (#27)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-chef-pull-requests #63](https://jclouds.ci.cloudbees.com/job/jclouds-chef-pull-requests/63/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/27#issuecomment-24733467

Re: [jclouds-chef] Make listCookbooksInEnvironment return empty set of CookbookDefinition o... (#27)

Posted by Ignasi Barrera <no...@github.com>.
>        Set<String> nodes = api.listNodesInEnvironment("dev");
>        assertTrue(nodes.isEmpty(), String.format("Expected nodes to be empty but was: %s", nodes));
>     }
>  
> +   public void testListCookbooksInEnvironmentReturnsEmptySetOn404() {
> +      ChefApi api = requestSendsResponse(
> +            signed(getHttpRequestBuilder("GET", "/environments/dev/cookbooks").build()),
> +            HttpResponse.builder().statusCode(404).build());
> +      Set<CookbookDefinition> cookbooks = api.listCookbooksInEnvironment("dev");
> +      assertTrue(cookbooks.isEmpty(), String.format("Expected cookbooks to be empty but was: %s", cookbooks));
> +   }
> +
> +   public void testListCookbooksInEnvironmentWithNumVersionReturnsEmptySetOn404() {
> +      ChefApi api = requestSendsResponse(
> +            signed(getHttpRequestBuilder("GET", "/environments/dev/cookbooks?num_versions=2").build()),

Minor cosmetic thing: use better the `addQueryParam` method.

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

Re: [jclouds-chef] Make listCookbooksInEnvironment return empty set of CookbookDefinition o... (#27)

Posted by CloudBees pull request builder plugin <no...@github.com>.
[jclouds-chef-pull-requests #65](https://jclouds.ci.cloudbees.com/job/jclouds-chef-pull-requests/65/) SUCCESS
This pull request looks good

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/27#issuecomment-24734201

Re: [jclouds-chef] Make listCookbooksInEnvironment return empty set of CookbookDefinition o... (#27)

Posted by BuildHive <no...@github.com>.
[jclouds » jclouds-chef #413](https://buildhive.cloudbees.com/job/jclouds/job/jclouds-chef/413/) SUCCESS
This pull request looks good
[(what's this?)](https://www.cloudbees.com/what-is-buildhive)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/27#issuecomment-24733251