List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry.client CFServiceInstance getDescription
String getDescription();
From source file:org.springframework.ide.eclipse.boot.dash.test.CloudFoundryClientTest.java
@Test public void getServices() throws Exception { RetryUtil.retryWhen("getServices", 5, FLAKY_SERVICE_BROKER, () -> { String[] serviceNames = new String[3]; Set<String> userProvided = new HashSet<>(); for (int i = 0; i < serviceNames.length; i++) { if (i % 2 == 0) { serviceNames[i] = services.createTestService(); } else { serviceNames[i] = services.createTestUserProvidedService(); userProvided.add(serviceNames[i]); }/*from w w w . j ava2s . co m*/ } List<CFServiceInstance> actualServices = client.getServices(); ImmutableSet<String> actualServiceNames = ImmutableSet .copyOf(actualServices.stream().map(CFServiceInstance::getName).collect(Collectors.toList())); for (CFServiceInstance s : actualServices) { //Note: because these test on CI host run in parallel with others using same space... // we should assume there might be 'extra stuff' on the space than what we just created here. //So only check that 'our stuff' exists and looks right and ignore the rest. String name = s.getName(); if (ImmutableSet.copyOf(serviceNames).contains(name)) { System.out.println("Verifying service: " + name); if (userProvided.contains(name)) { assertEquals("user-provided", s.getService()); System.out.println(" user provided => OK"); } else { assertEquals(services.getTestServiceAndPlan()[0], s.getService()); System.out.println(" getService() => OK"); String expectPlan = services.getTestServiceAndPlan()[1]; assertEquals(expectPlan, s.getPlan()); System.out.println(" getPlan() => OK"); assertIsURL(s.getDashboardUrl()); System.out.println(" getDashboardUrl() => OK"); assertIsURL(s.getDocumentationUrl()); System.out.println(" getDocumentationUrl() => OK"); assertText(s.getDescription()); System.out.println(" getDescription() => OK"); } } } for (String s : serviceNames) { assertTrue(s + " not found in " + actualServiceNames, actualServiceNames.contains(s)); } }); }