> +         assertEquals(dataCenter.version(), 1);
> +      } finally {
> +         pbApi.close();
> +         server.shutdown();
> +      }
> +   }
> +
> +   @Test
> +   public void testCreateDataCenterWithIllegalArguments() throws Exception {
> +      String[] names = {"JCl@ouds", "JC|ouds", "^clouds", ""};
> +      for (String name : names)
> +         try {
> +            DataCenter.Request.CreatePayload.create(name, Location.US_LAS);
> +            fail("Should have failed for name: ".concat(name));
> +         } catch (Exception ex) {
> +            assertTrue(ex instanceof IllegalArgumentException);

Why not just catching the `IllegalArgumentException`?

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

Reply via email to