KubernetesSecrets { public void delete() throws InfrastructureException { try { clientFactory .create(workspaceId) .secrets() .inNamespace(namespace) .withLabel(CHE_WORKSPACE_ID_LABEL, workspaceId) .withPropagationPolicy("Background") .delete(); } catch (KubernetesClientException e) { throw new KubernetesInfrastructureException(e); } } KubernetesSecrets(String namespace, String workspaceId, KubernetesClientFactory clientFactory); void create(Secret secret); List<Secret> get(LabelSelector labelSelector); void delete();  }
@Test public void testSecretsRemoving() throws Exception { kubernetesSecrets.delete(); verify(secretsMixedOperation).inNamespace(NAMESPACE); verify(nonNamespaceOperation).withLabel(CHE_WORKSPACE_ID_LABEL, WORKSPACE_ID); verify(deletableList).delete(); }