@Test void testUpdateServicePlan2() { CloudControllerClient client = getMockedClient(); Mockito.when(client.getServiceInstance(EXISTING_SERVICE_INSTANCE_NAME)) .thenReturn(EXISTING_SERVICE_INSTANCE); try { serviceUpdater.updateServicePlan(client, EXISTING_SERVICE_INSTANCE_NAME, "v3.0-large"); } catch (CloudOperationException e) { assertEquals("404 Not Found: Could not create service instance \"foo\". Service plan \"v3.0-large\" from service offering \"mongodb\" was not found.", e.getMessage()); } }
public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); }
ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } }
ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject  ServiceUpdater(WebClientFactory webClientFactory); }
ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject  ServiceUpdater(WebClientFactory webClientFactory); MethodExecution<String> updateServicePlanQuietly(CloudControllerClient client, String serviceName, String servicePlan); MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan); MethodExecution<String> updateServiceTagsQuietly(CloudControllerClient client, String serviceName, List<String> serviceTags); MethodExecution<String> updateServiceTags(CloudControllerClient client, String serviceName, List<String> serviceTags); MethodExecution<String> updateServiceParametersQuietly(CloudControllerClient client, String serviceName,
                                                                  Map<String, Object> parameters); MethodExecution<String> updateServiceParameters(CloudControllerClient client, String serviceName,
                                                           Map<String, Object> parameters); }
ServiceUpdater extends CloudServiceOperator { public MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan) { return new CustomControllerClientErrorHandler().handleErrorsOrReturnResult(() -> attemptToUpdateServicePlan(client, serviceName, servicePlan)); } @Inject  ServiceUpdater(WebClientFactory webClientFactory); MethodExecution<String> updateServicePlanQuietly(CloudControllerClient client, String serviceName, String servicePlan); MethodExecution<String> updateServicePlan(CloudControllerClient client, String serviceName, String servicePlan); MethodExecution<String> updateServiceTagsQuietly(CloudControllerClient client, String serviceName, List<String> serviceTags); MethodExecution<String> updateServiceTags(CloudControllerClient client, String serviceName, List<String> serviceTags); MethodExecution<String> updateServiceParametersQuietly(CloudControllerClient client, String serviceName,
                                                                  Map<String, Object> parameters); MethodExecution<String> updateServiceParameters(CloudControllerClient client, String serviceName,
                                                           Map<String, Object> parameters);  }