jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds] [Softlayer] Implements setting and retrieving the notes property (#756)
Date Wed, 03 Jun 2015 00:04:05 GMT
> +
> +   @BeforeClass
> +   public void init() {
> +      json = new GsonWrapper(new Gson());
> +   }
> +
> +   @Test
> +   public void testVirtualGuestWithOperatingSystem() {
> +      HttpRequest request = HttpRequest.builder().method("POST").endpoint("https://api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest").build();
> +      NotesToJson binder = new NotesToJson(json);
> +      String notes = "some notes";
> +
> +      request = binder.bindToRequest(request, notes);
> +
> +      assertEquals(request.getPayload().getRawContent(), "{\"parameters\":[{\"notes\":\"some
notes\"}]}");
> +   }

Add tests for the special cases too: null notes and empty String.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/756/files#r31583707
Mime
View raw message