@Test public void testDeregisterPayload() { UpdateLoadBalancerRequestBinder binder = new UpdateLoadBalancerRequestBinder(); LoadBalancer.Request.UpdatePayload payload = LoadBalancer.Request.updatingBuilder() .id("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") .name("load-balancer-name") .algorithm(LoadBalancer.Algorithm.ROUND_ROBIN) .ip("10.0.0.2") .build(); String actual = binder.createPayload(payload); assertNotNull(actual, "Binder returned null payload"); assertEquals(actual, expectedPayload); }
@Override protected String createPayload(LoadBalancer.Request.UpdatePayload payload) { return requestBuilder.append("<ws:updateLoadBalancer>") .append("<request>") .append(format("<loadBalancerId>%s</loadBalancerId>", payload.id())) .append(formatIfNotEmpty("<loadBalancerName>%s</loadBalancerName>", payload.name())) .append(formatIfNotEmpty("<loadBalancerAlgorithm>%s</loadBalancerAlgorithm>", payload.algorithm())) .append(formatIfNotEmpty("<ip>%s</ip>", payload.ip())) .append("</request>") .append("</ws:updateLoadBalancer>").toString(); }
UpdateLoadBalancerRequestBinder extends BaseProfitBricksRequestBinder<LoadBalancer.Request.UpdatePayload> { @Override protected String createPayload(LoadBalancer.Request.UpdatePayload payload) { return requestBuilder.append("<ws:updateLoadBalancer>") .append("<request>") .append(format("<loadBalancerId>%s</loadBalancerId>", payload.id())) .append(formatIfNotEmpty("<loadBalancerName>%s</loadBalancerName>", payload.name())) .append(formatIfNotEmpty("<loadBalancerAlgorithm>%s</loadBalancerAlgorithm>", payload.algorithm())) .append(formatIfNotEmpty("<ip>%s</ip>", payload.ip())) .append("</request>") .append("</ws:updateLoadBalancer>").toString(); } }
UpdateLoadBalancerRequestBinder extends BaseProfitBricksRequestBinder<LoadBalancer.Request.UpdatePayload> { @Override protected String createPayload(LoadBalancer.Request.UpdatePayload payload) { return requestBuilder.append("<ws:updateLoadBalancer>") .append("<request>") .append(format("<loadBalancerId>%s</loadBalancerId>", payload.id())) .append(formatIfNotEmpty("<loadBalancerName>%s</loadBalancerName>", payload.name())) .append(formatIfNotEmpty("<loadBalancerAlgorithm>%s</loadBalancerAlgorithm>", payload.algorithm())) .append(formatIfNotEmpty("<ip>%s</ip>", payload.ip())) .append("</request>") .append("</ws:updateLoadBalancer>").toString(); } UpdateLoadBalancerRequestBinder(); }
UpdateLoadBalancerRequestBinder extends BaseProfitBricksRequestBinder<LoadBalancer.Request.UpdatePayload> { @Override protected String createPayload(LoadBalancer.Request.UpdatePayload payload) { return requestBuilder.append("<ws:updateLoadBalancer>") .append("<request>") .append(format("<loadBalancerId>%s</loadBalancerId>", payload.id())) .append(formatIfNotEmpty("<loadBalancerName>%s</loadBalancerName>", payload.name())) .append(formatIfNotEmpty("<loadBalancerAlgorithm>%s</loadBalancerAlgorithm>", payload.algorithm())) .append(formatIfNotEmpty("<ip>%s</ip>", payload.ip())) .append("</request>") .append("</ws:updateLoadBalancer>").toString(); } UpdateLoadBalancerRequestBinder();  }
UpdateLoadBalancerRequestBinder extends BaseProfitBricksRequestBinder<LoadBalancer.Request.UpdatePayload> { @Override protected String createPayload(LoadBalancer.Request.UpdatePayload payload) { return requestBuilder.append("<ws:updateLoadBalancer>") .append("<request>") .append(format("<loadBalancerId>%s</loadBalancerId>", payload.id())) .append(formatIfNotEmpty("<loadBalancerName>%s</loadBalancerName>", payload.name())) .append(formatIfNotEmpty("<loadBalancerAlgorithm>%s</loadBalancerAlgorithm>", payload.algorithm())) .append(formatIfNotEmpty("<ip>%s</ip>", payload.ip())) .append("</request>") .append("</ws:updateLoadBalancer>").toString(); } UpdateLoadBalancerRequestBinder();   }