@Test public void testCreatePayload() { SetInternetAccessBinder binder = new SetInternetAccessBinder(); Nic.Request.SetInternetAccessPayload payload = Nic.Request.setInternetAccessBuilder() .dataCenterId("datacenter-id") .internetAccess(true) .lanId(1) .build(); String actual = binder.createPayload(payload); assertNotNull(actual, "Binder returned null payload"); assertEquals(actual, expectedPayload); }
@Override protected String createPayload(Nic.Request.SetInternetAccessPayload payload) { requestBuilder.append("<ws:setInternetAccess>") .append(format("<dataCenterId>%s</dataCenterId>", payload.dataCenterId())) .append(format("<lanId>%s</lanId>", payload.lanId())) .append(format("<internetAccess>%s</internetAccess>", payload.internetAccess())) .append("</ws:setInternetAccess>"); return requestBuilder.toString(); }
SetInternetAccessBinder extends BaseProfitBricksRequestBinder<Nic.Request.SetInternetAccessPayload> { @Override protected String createPayload(Nic.Request.SetInternetAccessPayload payload) { requestBuilder.append("<ws:setInternetAccess>") .append(format("<dataCenterId>%s</dataCenterId>", payload.dataCenterId())) .append(format("<lanId>%s</lanId>", payload.lanId())) .append(format("<internetAccess>%s</internetAccess>", payload.internetAccess())) .append("</ws:setInternetAccess>"); return requestBuilder.toString(); } }
SetInternetAccessBinder extends BaseProfitBricksRequestBinder<Nic.Request.SetInternetAccessPayload> { @Override protected String createPayload(Nic.Request.SetInternetAccessPayload payload) { requestBuilder.append("<ws:setInternetAccess>") .append(format("<dataCenterId>%s</dataCenterId>", payload.dataCenterId())) .append(format("<lanId>%s</lanId>", payload.lanId())) .append(format("<internetAccess>%s</internetAccess>", payload.internetAccess())) .append("</ws:setInternetAccess>"); return requestBuilder.toString(); } SetInternetAccessBinder(); }
SetInternetAccessBinder extends BaseProfitBricksRequestBinder<Nic.Request.SetInternetAccessPayload> { @Override protected String createPayload(Nic.Request.SetInternetAccessPayload payload) { requestBuilder.append("<ws:setInternetAccess>") .append(format("<dataCenterId>%s</dataCenterId>", payload.dataCenterId())) .append(format("<lanId>%s</lanId>", payload.lanId())) .append(format("<internetAccess>%s</internetAccess>", payload.internetAccess())) .append("</ws:setInternetAccess>"); return requestBuilder.toString(); } SetInternetAccessBinder();  }
SetInternetAccessBinder extends BaseProfitBricksRequestBinder<Nic.Request.SetInternetAccessPayload> { @Override protected String createPayload(Nic.Request.SetInternetAccessPayload payload) { requestBuilder.append("<ws:setInternetAccess>") .append(format("<dataCenterId>%s</dataCenterId>", payload.dataCenterId())) .append(format("<lanId>%s</lanId>", payload.lanId())) .append(format("<internetAccess>%s</internetAccess>", payload.internetAccess())) .append("</ws:setInternetAccess>"); return requestBuilder.toString(); } SetInternetAccessBinder();   }