@Test void testDefaultDomainException() { when(client.getDefaultDomain()).thenThrow(new CloudOperationException(HttpStatus.GATEWAY_TIMEOUT)); assertThrows(SLException.class, () -> step.execute(execution)); }
private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_DEFAULT_DOMAIN, true); return DEFAULT_DOMAIN_PLACEHOLDER; } throw e; } }
CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_DEFAULT_DOMAIN, true); return DEFAULT_DOMAIN_PLACEHOLDER; } throw e; } } }
CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_DEFAULT_DOMAIN, true); return DEFAULT_DOMAIN_PLACEHOLDER; } throw e; } }  }
CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_DEFAULT_DOMAIN, true); return DEFAULT_DOMAIN_PLACEHOLDER; } throw e; } }   }
CollectSystemParametersStep extends SyncFlowableStep { private String getDefaultDomain(CloudControllerClient client, ProcessContext context) { try { return client.getDefaultDomain() .getName(); } catch (CloudOperationException e) { if (e.getStatusCode() == HttpStatus.NOT_FOUND) { context.setVariable(Variables.MISSING_DEFAULT_DOMAIN, true); return DEFAULT_DOMAIN_PLACEHOLDER; } throw e; } }    }