Code example for ImmutableMap.Builder

Methods: build, put

0
 
      BindCloneVAppTemplateParamsToXmlPayload binder = injector
            .getInstance(BindCloneVAppTemplateParamsToXmlPayload.class); 
 
      Builder<String, Object> map = ImmutableMap.builder();
      map.put("name", "new-linux-server"); 
      map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/201"); 
      map.put("IsSourceDelete", "true"); 
 
      assertEquals(binder.bindToRequest(request, map.build()).getPayload().getRawContent(), expected);
   } 
 
   public void testDefault() throws IOException {
      String expected = toStringAndClose(getClass().getResourceAsStream("/copyVAppTemplate-default.xml"));
 
      GeneratedHttpRequest request = requestForArgs(ImmutableList.<Object> of());
 
      BindCloneVAppTemplateParamsToXmlPayload binder = injector
            .getInstance(BindCloneVAppTemplateParamsToXmlPayload.class); 
 
      Builder<String, Object> map = ImmutableMap.builder();
      map.put("name", "my-vapptemplate"); 
      map.put("Source", "https://vcenterprise.bluelock.com/api/v1.0/vAppTemplate/4181"); 
 
      assertEquals(binder.bindToRequest(request, map.build()).getPayload().getRawContent(), expected);
   } 
} 
Contextual code suggestions in your IDE  Get Codota for Java