@Test public void testCreate() { DeployedApplicationBuilder builder = getBuilder(); DeployedApplication app = new DeployedApplication(); app.create(builder); app.markAsClean(); app.getDeployedAppServices().values() .forEach(deployedAppService -> Assert.assertEquals(DeployedAppServiceState.pending, deployedAppService.getState())); Assert.assertEquals("myAppInstance", app.getName()); Assert.assertEquals(DeployedApplicationState.deploying, app.getState()); roll(app.markDataServiceAsCreating("db1BindName")); roll(app.markDataServiceAsCreated("db1BindName")); roll(app.markDataServiceAsBinding("db1BindName")); roll(app.markDataServiceAsBound("db1BindName", new DataServiceBoundEvent.BindingInfo( Collections.emptyMap(), Collections.emptyList()))); roll(app.markDataServiceAsCreating("db2BindName")); roll(app.markDataServiceAsCreated("db2BindName")); roll(app.markDataServiceAsBinding("db2BindName")); roll(app.markDataServiceAsBound("db2BindName", new DataServiceBoundEvent.BindingInfo( Collections.emptyMap(), Collections.emptyList()))); app.getDeployedAppServices().values() .forEach(deployedAppService -> Assert.assertEquals(DeployedAppServiceState.queued, deployedAppService.getState())); roll(app.markAppServiceAsDeploying("svc1")); roll(app.markAppServiceAsDeployed("svc1", "http: roll(app.markAppServiceAsDeploying("svc2")); roll(app.markAppServiceAsDeployed("svc2", null)); Assert.assertEquals(DeployedApplicationState.running, app.getState()); Assert.assertEquals("http: }
public DeployedApplication create(DeployedApplicationBuilder builder) { setExecutionEvent(builder.build()); return this; }
DeployedApplication { public DeployedApplication create(DeployedApplicationBuilder builder) { setExecutionEvent(builder.build()); return this; } }
DeployedApplication { public DeployedApplication create(DeployedApplicationBuilder builder) { setExecutionEvent(builder.build()); return this; } DeployedApplication(Collection<DeployedApplicationEvent> event);  DeployedApplication(); }
DeployedApplication { public DeployedApplication create(DeployedApplicationBuilder builder) { setExecutionEvent(builder.build()); return this; } DeployedApplication(Collection<DeployedApplicationEvent> event);  DeployedApplication(); UUID getId(); String getName(); String getAppTemplateName(); String getAppTemplateVersion(); Map<String, DeployedDataService> getDeployedDataServices(); Map<String, DeployedAppService> getDeployedAppServices(); Map<String, Map<String, Set<String>>> getAppServiceToDataServiceMappings(); Collection<DeployedDataService> getBoundServices(String appServiceName); String getEntryPointService(); DeployedApplicationState getState(); Date getStateDate(); Date getDeployedOn(); String getStateMessage(); String getEntryPointURL(); DeployedDataServicesPolicy getDataServicesPolicy(String name, String type); Collection<DeployedDataServicesPolicy> getDataServicesPolicies(); DeployedApplication stop(); DeployedApplication stop(String message); DeployedApplication create(DeployedApplicationBuilder builder); @NoJavadoc DeployedApplication markDataServiceAsCreating(String bindName); DeployedApplication markDataServiceAsCreated(String bindName); @NoJavadoc DeployedApplication markDataServiceAsCreated(String bindName, String message); @NoJavadoc DeployedApplication markDataServiceAsRemoving(String bindName); DeployedApplication markDataServiceAsRemoved(String bindName); DeployedApplication markDataServiceAsErrorRemoving(String bindName, String message); DeployedApplication markDataServiceAsErrorUnBinding(String bindName, String message); @NoJavadoc DeployedApplication markDataServiceAsUnbound(String bindName); @NoJavadoc DeployedApplication markDataServiceAsBinding(String bindName); DeployedApplication markDataServiceAsErrorBinding(String bindName, String message); DeployedApplication markDataServiceAsErrorCreating(String bindName, String message); DeployedApplication markPolicyAsError(String policyName, String policyType, String message); @NoJavadoc DeployedApplication markPolicyAsActivating(String policyName, String policyType); DeployedApplication markPolicyAsActive(String policyName, String policyType); DeployedApplication markDataServiceAsBound(String bindName, DataServiceBoundEvent.BindingInfo bindingInfo); @NoJavadoc DeployedApplication markAppServiceAsDeploying(String appServiceName); DeployedApplication markAppServiceAsError(String appServiceName, String message); DeployedApplication markAppServiceAsStopped(String appServiceName); DeployedApplication markAppServiceAsErrorStopping(String appServiceName, String message); DeployedApplication markAppServiceAsDeployed(String appServiceName, String publicURL); Collection<DeployedApplicationEvent> rollEvent(DeployedApplicationEvent event); DeployedApplicationEvent getExecutionEvent(); void setExecutionEvent(DeployedApplicationEvent executionEvent); }
DeployedApplication { public DeployedApplication create(DeployedApplicationBuilder builder) { setExecutionEvent(builder.build()); return this; } DeployedApplication(Collection<DeployedApplicationEvent> event);  DeployedApplication(); UUID getId(); String getName(); String getAppTemplateName(); String getAppTemplateVersion(); Map<String, DeployedDataService> getDeployedDataServices(); Map<String, DeployedAppService> getDeployedAppServices(); Map<String, Map<String, Set<String>>> getAppServiceToDataServiceMappings(); Collection<DeployedDataService> getBoundServices(String appServiceName); String getEntryPointService(); DeployedApplicationState getState(); Date getStateDate(); Date getDeployedOn(); String getStateMessage(); String getEntryPointURL(); DeployedDataServicesPolicy getDataServicesPolicy(String name, String type); Collection<DeployedDataServicesPolicy> getDataServicesPolicies(); DeployedApplication stop(); DeployedApplication stop(String message); DeployedApplication create(DeployedApplicationBuilder builder); @NoJavadoc DeployedApplication markDataServiceAsCreating(String bindName); DeployedApplication markDataServiceAsCreated(String bindName); @NoJavadoc DeployedApplication markDataServiceAsCreated(String bindName, String message); @NoJavadoc DeployedApplication markDataServiceAsRemoving(String bindName); DeployedApplication markDataServiceAsRemoved(String bindName); DeployedApplication markDataServiceAsErrorRemoving(String bindName, String message); DeployedApplication markDataServiceAsErrorUnBinding(String bindName, String message); @NoJavadoc DeployedApplication markDataServiceAsUnbound(String bindName); @NoJavadoc DeployedApplication markDataServiceAsBinding(String bindName); DeployedApplication markDataServiceAsErrorBinding(String bindName, String message); DeployedApplication markDataServiceAsErrorCreating(String bindName, String message); DeployedApplication markPolicyAsError(String policyName, String policyType, String message); @NoJavadoc DeployedApplication markPolicyAsActivating(String policyName, String policyType); DeployedApplication markPolicyAsActive(String policyName, String policyType); DeployedApplication markDataServiceAsBound(String bindName, DataServiceBoundEvent.BindingInfo bindingInfo); @NoJavadoc DeployedApplication markAppServiceAsDeploying(String appServiceName); DeployedApplication markAppServiceAsError(String appServiceName, String message); DeployedApplication markAppServiceAsStopped(String appServiceName); DeployedApplication markAppServiceAsErrorStopping(String appServiceName, String message); DeployedApplication markAppServiceAsDeployed(String appServiceName, String publicURL); Collection<DeployedApplicationEvent> rollEvent(DeployedApplicationEvent event); DeployedApplicationEvent getExecutionEvent(); void setExecutionEvent(DeployedApplicationEvent executionEvent);  }