> +      assertTrue(serverRemoved.apply(serverId), String.format("Server %s was 
> not removed in the configured timeout", serverId));
> +   }
> +   
> +   protected void assertNodeAvailable(String serverId) {
> +      assertTrue(serverAvailable.apply(serverId), String.format("Server %s 
> is not available", serverId));
> +   }
> +   
> +   protected DataCenter createDataCenter() {
> +      return api.dataCenterApi().create("test-data-center", "example 
> description", TestLocation.value());
> +   }
> +   
> +   protected void deleteDataCenter(String id) {
> +      api.dataCenterApi().delete(id);
> +   }
> +   
> +   protected String complexId(String ... ids) {

This `complexId` thing is horrible. It is coupling the codebase with the fact 
that you concatenate IDs for convenience. For example, the predicates defined 
in the predicates module have to split the input string, just because "they 
know" it is the concatenation of two IDs.

Instead of coupling concrete behavior in the entire codebase, and doing 
concatenations and splits here and there, create a proper `ServerRef` or 
`DatacenterAndServer`, or whatever, that you can pass between application 
layers, and provides convenient constructors and accessors for the internal 
IDs. This way the predicate remains clean, and the entire codebase remains 
clean and the "id encoding" logic properly encapsulated.

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

Reply via email to