Have a look at the [DropletToNodeMetadataTest](https://github.com/jclouds/jclouds-labs/blob/master/digitalocean/src/test/java/org/jclouds/digitalocean/compute/functions/DropletToNodeMetadataTest.java) class, which is the test used in the DigitalOcean provider. It tests pretty much the same thing, and might give you some idea of a cleaner setup.