@Test public void testAddRomDriveToServerPayload() { AddRomDriveToServerRequestBinder binder = new AddRomDriveToServerRequestBinder(); Drive.Request.AddRomDriveToServerPayload payload = Drive.Request.AddRomDriveToServerPayload.builder() .serverId("server-id") .imageId("image-id") .deviceNumber("device-number") .build(); String actual = binder.createPayload(payload); assertEquals(actual, expectedPayload); }
@Override protected String createPayload(Drive.Request.AddRomDriveToServerPayload payload) { requestBuilder.append("<ws:addRomDriveToServer>") .append("<request>") .append(format("<imageId>%s</imageId>", payload.imageId())) .append(format("<serverId>%s</serverId>", payload.serverId())) .append(formatIfNotEmpty("<deviceNumber>%s</deviceNumber>", payload.deviceNumber())) .append("</request>") .append("</ws:addRomDriveToServer>"); return requestBuilder.toString(); }
AddRomDriveToServerRequestBinder extends BaseProfitBricksRequestBinder<Drive.Request.AddRomDriveToServerPayload> { @Override protected String createPayload(Drive.Request.AddRomDriveToServerPayload payload) { requestBuilder.append("<ws:addRomDriveToServer>") .append("<request>") .append(format("<imageId>%s</imageId>", payload.imageId())) .append(format("<serverId>%s</serverId>", payload.serverId())) .append(formatIfNotEmpty("<deviceNumber>%s</deviceNumber>", payload.deviceNumber())) .append("</request>") .append("</ws:addRomDriveToServer>"); return requestBuilder.toString(); } }
AddRomDriveToServerRequestBinder extends BaseProfitBricksRequestBinder<Drive.Request.AddRomDriveToServerPayload> { @Override protected String createPayload(Drive.Request.AddRomDriveToServerPayload payload) { requestBuilder.append("<ws:addRomDriveToServer>") .append("<request>") .append(format("<imageId>%s</imageId>", payload.imageId())) .append(format("<serverId>%s</serverId>", payload.serverId())) .append(formatIfNotEmpty("<deviceNumber>%s</deviceNumber>", payload.deviceNumber())) .append("</request>") .append("</ws:addRomDriveToServer>"); return requestBuilder.toString(); } AddRomDriveToServerRequestBinder(); }
AddRomDriveToServerRequestBinder extends BaseProfitBricksRequestBinder<Drive.Request.AddRomDriveToServerPayload> { @Override protected String createPayload(Drive.Request.AddRomDriveToServerPayload payload) { requestBuilder.append("<ws:addRomDriveToServer>") .append("<request>") .append(format("<imageId>%s</imageId>", payload.imageId())) .append(format("<serverId>%s</serverId>", payload.serverId())) .append(formatIfNotEmpty("<deviceNumber>%s</deviceNumber>", payload.deviceNumber())) .append("</request>") .append("</ws:addRomDriveToServer>"); return requestBuilder.toString(); } AddRomDriveToServerRequestBinder();  }
AddRomDriveToServerRequestBinder extends BaseProfitBricksRequestBinder<Drive.Request.AddRomDriveToServerPayload> { @Override protected String createPayload(Drive.Request.AddRomDriveToServerPayload payload) { requestBuilder.append("<ws:addRomDriveToServer>") .append("<request>") .append(format("<imageId>%s</imageId>", payload.imageId())) .append(format("<serverId>%s</serverId>", payload.serverId())) .append(formatIfNotEmpty("<deviceNumber>%s</deviceNumber>", payload.deviceNumber())) .append("</request>") .append("</ws:addRomDriveToServer>"); return requestBuilder.toString(); } AddRomDriveToServerRequestBinder();   }