Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudAppDashElement getHealthCheck

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudAppDashElement getHealthCheck

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudAppDashElement getHealthCheck.

Prototype

public String getHealthCheck() 

Source Link

Usage

From source file:org.springframework.ide.eclipse.boot.dash.test.CloudFoundryBootDashModelMockingTest.java

@Test
public void testRefreshAppsHealthCheck() throws Exception {
    CFClientParams targetParams = CfTestTargetParams.fromEnv();

    MockCFSpace space = clientFactory.defSpace(targetParams.getOrgName(), targetParams.getSpaceName());

    final MockCFApplication foo = space.defApp("foo");

    final CloudFoundryBootDashModel target = harness.createCfTarget(targetParams);

    waitForApps(target, "foo");

    CloudAppDashElement appElement = harness.getCfTargetModel().getApplication("foo");
    assertEquals(HealthChecks.HC_PORT, appElement.getHealthCheck());

    foo.setHealthCheck(HealthChecks.HC_NONE);

    target.refresh(ui);/*from  w w  w . ja v a2 s. com*/

    new ACondition("wait for app health check", 3000) {
        @Override
        public boolean test() throws Exception {
            ImmutableSet<String> appNames = getNames(target.getApplications().getValues());
            assertEquals(ImmutableSet.of("foo"), appNames);

            CloudAppDashElement appElement = harness.getCfTargetModel().getApplication("foo");
            assertEquals(HealthChecks.HC_NONE, appElement.getHealthCheck());

            return true;
        }
    };
}