OpenShiftProject extends KubernetesNamespace { void prepare(boolean canCreate) throws InfrastructureException { String workspaceId = getWorkspaceId(); String projectName = getName(); KubernetesClient kubeClient = clientFactory.create(workspaceId); OpenShiftClient osClient = clientFactory.createOC(workspaceId); Project project = get(projectName, osClient); if (project == null) { if (!canCreate) { throw new InfrastructureException( format( "Creating the namespace '%s' is not allowed, yet" + " it was not found.", projectName)); } create(projectName, osClient); waitDefaultServiceAccount(projectName, kubeClient); } } @VisibleForTesting  OpenShiftProject(
      OpenShiftClientFactory clientFactory,
      String workspaceId,
      String name,
      KubernetesDeployments deployments,
      KubernetesServices services,
      OpenShiftRoutes routes,
      KubernetesPersistentVolumeClaims pvcs,
      KubernetesIngresses ingresses,
      KubernetesSecrets secrets,
      KubernetesConfigsMaps configMaps);  OpenShiftProject(
      OpenShiftClientFactory clientFactory, Executor executor, String name, String workspaceId); OpenShiftRoutes routes(); void cleanUp();  }
@Test public void testOpenShiftProjectPreparingWhenProjectExists() throws Exception { MetadataNested projectMeta = prepareProjectRequest(); prepareProject(PROJECT_NAME); OpenShiftProject project = new OpenShiftProject(clientFactory, executor, PROJECT_NAME, WORKSPACE_ID); project.prepare(true); verify(projectMeta, never()).withName(PROJECT_NAME); }