DefaultDeployment { public void createDefaultDeployment(DeployerConfig deployerConfig, AuthConfig authConfig, ServiceHost xenonHost) throws Throwable { xenonHost.registerForServiceAvailability((Operation operation, Throwable throwable) -> { DeploymentService.State startState = buildServiceStartState(deployerConfig, authConfig); Operation op = Operation.createPost( UriUtils.buildUri(xenonHost, DeploymentServiceFactory.SELF_LINK, null)) .setReferer(xenonHost.getUri()) .setBody(startState); xenonHost.sendRequest(op); }, DeploymentServiceFactory.SELF_LINK); }  void createDefaultDeployment(DeployerConfig deployerConfig,
                                      AuthConfig authConfig,
                                      ServiceHost xenonHost); void createDefaultDeployment(final ServiceHost host,
                                      final AuthConfig authConfig,
                                      final DeployerConfig deployerConfig,
                                      final String lbIpAddress);  }
@Test public void testDefaultDeploymentGetsCreated() throws Throwable { ArrayList<String> peers = new ArrayList<>(); for (ServiceHost host : testEnvironment.getHosts()) { peers.add(host.getUri().toString()); } DefaultDeployment defaultDeployment = new DefaultDeployment(); defaultDeployment.createDefaultDeployment( photonControllereConfig.getDeployerConfig(), photonControllereConfig.getAuth(), testEnvironment.getHosts()[0]); defaultDeployment.createDefaultDeployment( photonControllereConfig.getDeployerConfig(), photonControllereConfig.getAuth(), testEnvironment.getHosts()[1]); defaultDeployment.createDefaultDeployment( photonControllereConfig.getDeployerConfig(), photonControllereConfig.getAuth(), testEnvironment.getHosts()[2]); ServiceHostUtils.waitForNodeGroupConvergence( testEnvironment.getHosts(), ServiceUriPaths.DEFAULT_NODE_GROUP); String selfLink = DeploymentServiceFactory.SELF_LINK + "/" + DeployerDefaults.DEFAULT_DEPLOYMENT_ID; try { ServiceHostUtils.waitForServiceAvailability(testEnvironment.getHosts()[0], MultiHostEnvironment.WAIT_ITERATION_COUNT, selfLink); } catch (Exception ex) { fail("Failed to create default deployment."); } }