@Test public void testCreatePayload() { CreateDataCenterRequestBinder binder = new CreateDataCenterRequestBinder(); DataCenter.Request.CreatePayload payload = DataCenter.Request.creatingPayload("JClouds-DC", Location.DE_FKB); String actual = binder.createPayload(payload); assertNotNull(actual, "Binder returned null payload"); assertEquals(actual, expectedPayload); }
@Override protected String createPayload(DataCenter.Request.CreatePayload payload) { requestBuilder.append("<ws:createDataCenter>") .append("<request>") .append(format("<dataCenterName>%s</dataCenterName>", payload.name())) .append(format("<location>%s</location>", payload.location().getId())) .append("</request>") .append("</ws:createDataCenter>"); return requestBuilder.toString(); }
CreateDataCenterRequestBinder extends BaseProfitBricksRequestBinder<DataCenter.Request.CreatePayload> { @Override protected String createPayload(DataCenter.Request.CreatePayload payload) { requestBuilder.append("<ws:createDataCenter>") .append("<request>") .append(format("<dataCenterName>%s</dataCenterName>", payload.name())) .append(format("<location>%s</location>", payload.location().getId())) .append("</request>") .append("</ws:createDataCenter>"); return requestBuilder.toString(); } }
CreateDataCenterRequestBinder extends BaseProfitBricksRequestBinder<DataCenter.Request.CreatePayload> { @Override protected String createPayload(DataCenter.Request.CreatePayload payload) { requestBuilder.append("<ws:createDataCenter>") .append("<request>") .append(format("<dataCenterName>%s</dataCenterName>", payload.name())) .append(format("<location>%s</location>", payload.location().getId())) .append("</request>") .append("</ws:createDataCenter>"); return requestBuilder.toString(); } CreateDataCenterRequestBinder(); }
CreateDataCenterRequestBinder extends BaseProfitBricksRequestBinder<DataCenter.Request.CreatePayload> { @Override protected String createPayload(DataCenter.Request.CreatePayload payload) { requestBuilder.append("<ws:createDataCenter>") .append("<request>") .append(format("<dataCenterName>%s</dataCenterName>", payload.name())) .append(format("<location>%s</location>", payload.location().getId())) .append("</request>") .append("</ws:createDataCenter>"); return requestBuilder.toString(); } CreateDataCenterRequestBinder();  }
CreateDataCenterRequestBinder extends BaseProfitBricksRequestBinder<DataCenter.Request.CreatePayload> { @Override protected String createPayload(DataCenter.Request.CreatePayload payload) { requestBuilder.append("<ws:createDataCenter>") .append("<request>") .append(format("<dataCenterName>%s</dataCenterName>", payload.name())) .append(format("<location>%s</location>", payload.location().getId())) .append("</request>") .append("</ws:createDataCenter>"); return requestBuilder.toString(); } CreateDataCenterRequestBinder();   }