@Test public void test_unbind_application_should_succeed() throws CloudFoundryException { ServiceBindingsV2 serviceBindings = mock(ServiceBindingsV2.class); when(cfClient.serviceBindingsV2()).thenReturn(serviceBindings); when(serviceBindings.delete(any(DeleteServiceBindingRequest.class))) .thenReturn(Mono.empty()); cloudFoundryApi.unbind("service-binding-id"); verify(serviceBindings, times(1)).delete(any(DeleteServiceBindingRequest.class)); }
@Override public void unbind(String bindingId) throws CloudFoundryException { try { cfClient.serviceBindingsV2() .delete(DeleteServiceBindingRequest.builder() .serviceBindingId(bindingId) .build()) .block(Config.CF_API_TIMEOUT); } catch (RuntimeException r) { throw new CloudFoundryException(r); } }
CloudFoundryApi implements CloudFoundryApiService { @Override public void unbind(String bindingId) throws CloudFoundryException { try { cfClient.serviceBindingsV2() .delete(DeleteServiceBindingRequest.builder() .serviceBindingId(bindingId) .build()) .block(Config.CF_API_TIMEOUT); } catch (RuntimeException r) { throw new CloudFoundryException(r); } } }
CloudFoundryApi implements CloudFoundryApiService { @Override public void unbind(String bindingId) throws CloudFoundryException { try { cfClient.serviceBindingsV2() .delete(DeleteServiceBindingRequest.builder() .serviceBindingId(bindingId) .build()) .block(Config.CF_API_TIMEOUT); } catch (RuntimeException r) { throw new CloudFoundryException(r); } }  }
CloudFoundryApi implements CloudFoundryApiService { @Override public void unbind(String bindingId) throws CloudFoundryException { try { cfClient.serviceBindingsV2() .delete(DeleteServiceBindingRequest.builder() .serviceBindingId(bindingId) .build()) .block(Config.CF_API_TIMEOUT); } catch (RuntimeException r) { throw new CloudFoundryException(r); } }  @Override void bindApplications(String serviceInstanceId, List<ApplicationIdentity> applications); void bindRoutes(String serviceInstanceId, List<String> routeIds); @Override ApplicationActivity getApplicationActivity(String appUid); Instant getInstantFromLogMessageTimestamp(Long logMessageTimestamp); @Override String getApplicationState(String applicationUuid); @Override String getHost(String routeId); @Override boolean isAppRunning(String appUid); @Override List<ApplicationIdentity> listAliveApplications(String spaceUuid, Pattern excludeNames); @Override List<String> listApplicationRoutes(String applicationUuid); @Override List<String> listRouteApplications(String routeUuid); @Override boolean startApplication(String applicationUuid); @Override boolean stopApplication(String applicationUuid); @Override void unbind(String bindingId); boolean isValidOrganization(String organizationGuid); }
CloudFoundryApi implements CloudFoundryApiService { @Override public void unbind(String bindingId) throws CloudFoundryException { try { cfClient.serviceBindingsV2() .delete(DeleteServiceBindingRequest.builder() .serviceBindingId(bindingId) .build()) .block(Config.CF_API_TIMEOUT); } catch (RuntimeException r) { throw new CloudFoundryException(r); } }  @Override void bindApplications(String serviceInstanceId, List<ApplicationIdentity> applications); void bindRoutes(String serviceInstanceId, List<String> routeIds); @Override ApplicationActivity getApplicationActivity(String appUid); Instant getInstantFromLogMessageTimestamp(Long logMessageTimestamp); @Override String getApplicationState(String applicationUuid); @Override String getHost(String routeId); @Override boolean isAppRunning(String appUid); @Override List<ApplicationIdentity> listAliveApplications(String spaceUuid, Pattern excludeNames); @Override List<String> listApplicationRoutes(String applicationUuid); @Override List<String> listRouteApplications(String routeUuid); @Override boolean startApplication(String applicationUuid); @Override boolean stopApplication(String applicationUuid); @Override void unbind(String bindingId); boolean isValidOrganization(String organizationGuid);  }