### Question:
DeleteApplicationStep extends UndeployAppStep { private void deleteApplication(CloudControllerClient client, String applicationName) { getStepLogger().info(Messages.DELETING_APP, applicationName); client.deleteApplication(applicationName); getStepLogger().debug(Messages.APP_DELETED, applicationName); }    }### Answer:
@Test void testApplicationNotFoundExceptionThrown() { Mockito.doThrow(new CloudOperationException(HttpStatus.NOT_FOUND)) .when(client) .deleteApplication(anyString()); context.setVariable(Variables.APP_TO_PROCESS, createCloudApplication("test-app")); step.execute(execution); assertStepFinishedSuccessfully(); }
@Test void testBadGatewayExceptionThrown() { Mockito.doThrow(new CloudOperationException(HttpStatus.BAD_GATEWAY)) .when(client) .deleteApplication(anyString()); context.setVariable(Variables.APP_TO_PROCESS, createCloudApplication("test-app")); Assertions.assertThrows(SLException.class, () -> step.execute(execution)); }