> @@ -156,6 +158,33 @@ public void testListNodesInEnvironmentReturns404() {
> assertTrue(nodes.isEmpty(), String.format("Expected nodes to be empty
> but was: %s", nodes));
> }
>
> + public void testListCookbooksInEnvironmentReturns2xx() {
> + ChefApi api = requestSendsResponse(
> + signed(HttpRequest.builder() //
> + .method("GET") //
> +
> .endpoint("http://localhost:4000/environments/dev/cookbooks") //
> + .addHeader("X-Chef-Version",
> ChefApiMetadata.DEFAULT_API_VERSION) //
> + .addHeader("Accept", MediaType.APPLICATION_JSON).build()),
> //
> + HttpResponse.builder().statusCode(200)
> +
> .payload(payloadFromResourceWithContentType("/env_cookbooks.json",
> MediaType.APPLICATION_JSON)) //
> + .build());
> + Set<CookbookDefinition> cookbooks =
> api.listCookbooksInEnvironment("dev");
> + assertEquals(cookbooks.size(), 2);
> + }
> +
> + public void testListCookbooksInEnvironmentReturns404() {
Let me remove this test case, so that I add this in the next PR which will
contain the fix to return empty list on 404.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-chef/pull/24/files#r6428072