@Test public void testCreatePayload() { ConnectStorageToServerRequestBinder binder = new ConnectStorageToServerRequestBinder(); Storage.Request.ConnectPayload payload = Storage.Request.connectingBuilder() .serverId("qwertyui-qwer-qwer-qwer-qwertyyuiiop") .storageId("qswdefrg-qaws-qaws-defe-rgrgdsvcxbrh") .busType(Storage.BusType.VIRTIO) .deviceNumber(2) .build(); String actual = binder.createPayload(payload); assertNotNull(actual, "Binder returned null payload"); assertEquals(actual, expectedPayload); }
@Override protected String createPayload(Storage.Request.ConnectPayload payload) { requestBuilder.append("<ws:connectStorageToServer>") .append("<request>") .append(format("<storageId>%s</storageId>", payload.storageId())) .append(format("<serverId>%s</serverId>", payload.serverId())) .append(formatIfNotEmpty("<busType>%s</busType>", payload.busType())) .append(formatIfNotEmpty("<deviceNumber>%s</deviceNumber>", payload.deviceNumber())) .append("</request>") .append("</ws:connectStorageToServer>"); return requestBuilder.toString(); }
ConnectStorageToServerRequestBinder extends BaseProfitBricksRequestBinder<Storage.Request.ConnectPayload> { @Override protected String createPayload(Storage.Request.ConnectPayload payload) { requestBuilder.append("<ws:connectStorageToServer>") .append("<request>") .append(format("<storageId>%s</storageId>", payload.storageId())) .append(format("<serverId>%s</serverId>", payload.serverId())) .append(formatIfNotEmpty("<busType>%s</busType>", payload.busType())) .append(formatIfNotEmpty("<deviceNumber>%s</deviceNumber>", payload.deviceNumber())) .append("</request>") .append("</ws:connectStorageToServer>"); return requestBuilder.toString(); } }
ConnectStorageToServerRequestBinder extends BaseProfitBricksRequestBinder<Storage.Request.ConnectPayload> { @Override protected String createPayload(Storage.Request.ConnectPayload payload) { requestBuilder.append("<ws:connectStorageToServer>") .append("<request>") .append(format("<storageId>%s</storageId>", payload.storageId())) .append(format("<serverId>%s</serverId>", payload.serverId())) .append(formatIfNotEmpty("<busType>%s</busType>", payload.busType())) .append(formatIfNotEmpty("<deviceNumber>%s</deviceNumber>", payload.deviceNumber())) .append("</request>") .append("</ws:connectStorageToServer>"); return requestBuilder.toString(); } ConnectStorageToServerRequestBinder(); }
ConnectStorageToServerRequestBinder extends BaseProfitBricksRequestBinder<Storage.Request.ConnectPayload> { @Override protected String createPayload(Storage.Request.ConnectPayload payload) { requestBuilder.append("<ws:connectStorageToServer>") .append("<request>") .append(format("<storageId>%s</storageId>", payload.storageId())) .append(format("<serverId>%s</serverId>", payload.serverId())) .append(formatIfNotEmpty("<busType>%s</busType>", payload.busType())) .append(formatIfNotEmpty("<deviceNumber>%s</deviceNumber>", payload.deviceNumber())) .append("</request>") .append("</ws:connectStorageToServer>"); return requestBuilder.toString(); } ConnectStorageToServerRequestBinder();  }
ConnectStorageToServerRequestBinder extends BaseProfitBricksRequestBinder<Storage.Request.ConnectPayload> { @Override protected String createPayload(Storage.Request.ConnectPayload payload) { requestBuilder.append("<ws:connectStorageToServer>") .append("<request>") .append(format("<storageId>%s</storageId>", payload.storageId())) .append(format("<serverId>%s</serverId>", payload.serverId())) .append(formatIfNotEmpty("<busType>%s</busType>", payload.busType())) .append(formatIfNotEmpty("<deviceNumber>%s</deviceNumber>", payload.deviceNumber())) .append("</request>") .append("</ws:connectStorageToServer>"); return requestBuilder.toString(); } ConnectStorageToServerRequestBinder();   }