> +         authenticatedGET().endpoint(endpoint + 
> "/routers").addQueryParam("fields", "id", "tenant_id", "name").build(),
> +         
> HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/list_routers.json",
>  APPLICATION_JSON)).build())
> +         .getRouterExtensionForZone(ZONE).get();
> +
> +      Set<? extends ReferenceWithName> references = 
> api.list().concat().toSet();
> +      assertEquals(references, listOfReferencesWithNames());
> +   }
> +
> +   public void testListReferencesReturns4xx() {
> +      RouterApi api = requestsSendResponses(
> +         keystoneAuthWithUsernameAndPasswordAndTenantName, 
> responseWithKeystoneAccess,
> +         authenticatedGET().endpoint(endpoint + 
> "/routers").addQueryParam("fields", "id", "tenant_id", "name").build(),
> +         HttpResponse.builder().statusCode(404).build())
> +         .getRouterExtensionForZone(ZONE).get();
> +
> +      assertTrue(api.list().concat().isEmpty());

> What exactly do you mean by this messages?

I'll start out by admitting that I am much more interested in this than the 
other jclouds reviewers, mainly because I often end up clicking on the PR 
builder links and looking at the notification emails to try to figure out build 
status. So I'll be fine if we leave things as-is.

Having said that, what I mean is writing assertions like
```
assertTrue(api.list().concat().isEmpty(), "Expected no results to be returned, 
but was " + api.list().concat());
```
or similar, rather than just
```
assertTrue(api.list().concat().isEmpty());
```
With the latter style, if you drill down to the code you obviously can also see 
what the test is trying to do. But in a Jenkins report all you get is 
"Assertion failed", and then I usually have to go over to GitHub to drill down 
into the source code to figure out what's going on.

For tests with only _one_ assertion the test name itself can be enough, but in 
this case, for instance, it would also be nice to know _what_ was returned, 
rather than just that _something_ was returned.

Does this make some kind of sense? ;-)

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/47/files#r8063301

Reply via email to