@Test public void testCreatePayload() { CreateSnapshotRequestBinder binder = new CreateSnapshotRequestBinder(); Snapshot.Request.CreatePayload payload = Snapshot.Request.creatingBuilder() .storageId("123-1233-1324") .name("snapshot-name") .description("describing-the-snapshot") .build(); String actual = binder.createPayload(payload); assertNotNull(actual, "Binder returned null payload"); assertEquals(actual, expectedPayload); }
@Override protected String createPayload(Snapshot.Request.CreatePayload payload) { requestBuilder.append("<ws:createSnapshot>") .append("<request>") .append(format("<storageId>%s</storageId>", payload.storageId())) .append(formatIfNotEmpty("<description>%s</description>", payload.description())) .append(formatIfNotEmpty("<snapshotName>%s</snapshotName>", payload.name())) .append("</request>") .append("</ws:createSnapshot>"); return requestBuilder.toString(); }
CreateSnapshotRequestBinder extends BaseProfitBricksRequestBinder<Snapshot.Request.CreatePayload> { @Override protected String createPayload(Snapshot.Request.CreatePayload payload) { requestBuilder.append("<ws:createSnapshot>") .append("<request>") .append(format("<storageId>%s</storageId>", payload.storageId())) .append(formatIfNotEmpty("<description>%s</description>", payload.description())) .append(formatIfNotEmpty("<snapshotName>%s</snapshotName>", payload.name())) .append("</request>") .append("</ws:createSnapshot>"); return requestBuilder.toString(); } }
CreateSnapshotRequestBinder extends BaseProfitBricksRequestBinder<Snapshot.Request.CreatePayload> { @Override protected String createPayload(Snapshot.Request.CreatePayload payload) { requestBuilder.append("<ws:createSnapshot>") .append("<request>") .append(format("<storageId>%s</storageId>", payload.storageId())) .append(formatIfNotEmpty("<description>%s</description>", payload.description())) .append(formatIfNotEmpty("<snapshotName>%s</snapshotName>", payload.name())) .append("</request>") .append("</ws:createSnapshot>"); return requestBuilder.toString(); } protected  CreateSnapshotRequestBinder(); }
CreateSnapshotRequestBinder extends BaseProfitBricksRequestBinder<Snapshot.Request.CreatePayload> { @Override protected String createPayload(Snapshot.Request.CreatePayload payload) { requestBuilder.append("<ws:createSnapshot>") .append("<request>") .append(format("<storageId>%s</storageId>", payload.storageId())) .append(formatIfNotEmpty("<description>%s</description>", payload.description())) .append(formatIfNotEmpty("<snapshotName>%s</snapshotName>", payload.name())) .append("</request>") .append("</ws:createSnapshot>"); return requestBuilder.toString(); } protected  CreateSnapshotRequestBinder();  }
CreateSnapshotRequestBinder extends BaseProfitBricksRequestBinder<Snapshot.Request.CreatePayload> { @Override protected String createPayload(Snapshot.Request.CreatePayload payload) { requestBuilder.append("<ws:createSnapshot>") .append("<request>") .append(format("<storageId>%s</storageId>", payload.storageId())) .append(formatIfNotEmpty("<description>%s</description>", payload.description())) .append(formatIfNotEmpty("<snapshotName>%s</snapshotName>", payload.name())) .append("</request>") .append("</ws:createSnapshot>"); return requestBuilder.toString(); } protected  CreateSnapshotRequestBinder();   }