Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudFoundryBootDashModel delete

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry CloudFoundryBootDashModel delete

Introduction

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

Prototype

@Override
    public void delete(Collection<BootDashElement> toRemove, UserInteractions ui) 

Source Link

Usage

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

@Test
public void deleteService() throws Exception {
    String serviceName = services.createTestService();
    CFClientParams targetParams = CfTestTargetParams.fromEnv();

    CloudFoundryBootDashModel model = harness.createCfTarget(targetParams);

    ACondition.waitFor("service to appear", APP_IS_VISIBLE_TIMEOUT, () -> {
        assertNotNull(model.getService(serviceName));
    });/*from  www . j a v  a2  s  .  c  o  m*/

    when(ui.confirmOperation(contains("Deleting"), contains("Are you sure that you want to delete")))
            .thenReturn(true);

    CloudServiceInstanceDashElement service = model.getService(serviceName);
    model.canDelete(service);
    model.delete(ImmutableSet.of(service), ui);

    ACondition.waitFor("service to disapear", SERVICE_DELETE_TIMEOUT, () -> {
        assertNull(model.getService(serviceName));
    });

}