### Question:
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; } }    }### Answer:
@Test void testDefaultDomainNotFoundException() { prepareDescriptor("system-parameters/mtad.yaml"); prepareClient(); when(client.getDefaultDomain()).thenThrow(new CloudOperationException(HttpStatus.NOT_FOUND)); step.execute(execution); assertTrue(context.getVariable(Variables.MISSING_DEFAULT_DOMAIN)); DeploymentDescriptor descriptor = context.getVariable(Variables.DEPLOYMENT_DESCRIPTOR_WITH_SYSTEM_PARAMETERS); assertEquals(DEFAULT_DOMAIN_PLACEHOLDER, descriptor.getParameters() .get(SupportedParameters.DEFAULT_DOMAIN)); }
@Test void testDefaultDomainException() { when(client.getDefaultDomain()).thenThrow(new CloudOperationException(HttpStatus.GATEWAY_TIMEOUT)); assertThrows(SLException.class, () -> step.execute(execution)); }