use of org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl.WorkspaceImplBuilder in project devspaces-images by redhat-developer.
the class KubernetesNamespaceFactoryTest method testEvalNamespaceUsesNamespaceDefaultIfWorkspaceDoesntRecordNamespaceAndLegacyNamespaceDoesntExist.
@Test
public void testEvalNamespaceUsesNamespaceDefaultIfWorkspaceDoesntRecordNamespaceAndLegacyNamespaceDoesntExist() throws Exception {
namespaceFactory = new KubernetesNamespaceFactory("che-<userid>", true, true, true, NAMESPACE_LABELS, NAMESPACE_ANNOTATIONS, emptySet(), clientFactory, cheClientFactory, userManager, preferenceManager, pool);
WorkspaceImpl workspace = new WorkspaceImplBuilder().setId("workspace123").setAttributes(emptyMap()).build();
EnvironmentContext.getCurrent().setSubject(new SubjectImpl("jondoe", "123", null, false));
String namespace = namespaceFactory.getNamespaceName(workspace);
assertEquals(namespace, "che-123");
}
Aggregations