use of org.eclipse.che.api.workspace.server.spi.NamespaceResolutionContext in project che-server by eclipse-che.
the class UserPermissionConfiguratorTest method setUp.
@BeforeMethod
public void setUp() throws InfrastructureException {
configurator = new UserPermissionConfigurator(TEST_CLUSTER_ROLES, clientFactory);
serverMock = new KubernetesServer(true, true);
serverMock.before();
client = spy(serverMock.getClient());
lenient().when(clientFactory.create()).thenReturn(client);
namespaceResolutionContext = new NamespaceResolutionContext(TEST_WORKSPACE_ID, TEST_USER_ID, TEST_USERNAME);
}
use of org.eclipse.che.api.workspace.server.spi.NamespaceResolutionContext in project che-server by eclipse-che.
the class UserProfileConfiguratorTest method setUp.
@BeforeMethod
public void setUp() throws InfrastructureException, NotFoundException, ServerException {
context = new NamespaceResolutionContext(null, USER_ID, USER_NAME);
kubernetesServer = new KubernetesServer(true, true);
kubernetesServer.before();
when(userManager.getById(USER_ID)).thenReturn(new UserImpl(USER_ID, USER_EMAIL, USER_NAME));
when(clientFactory.create()).thenReturn(kubernetesServer.getClient());
}
use of org.eclipse.che.api.workspace.server.spi.NamespaceResolutionContext in project devspaces-images by redhat-developer.
the class PreferencesConfigMapConfiguratorTest method setUp.
@BeforeMethod
public void setUp() throws InfrastructureException {
configurator = new PreferencesConfigMapConfigurator(clientFactory);
serverMock = new KubernetesServer(true, true);
serverMock.before();
KubernetesClient client = spy(serverMock.getClient());
when(clientFactory.create()).thenReturn(client);
namespaceResolutionContext = new NamespaceResolutionContext(TEST_WORKSPACE_ID, TEST_USER_ID, TEST_USERNAME);
}
use of org.eclipse.che.api.workspace.server.spi.NamespaceResolutionContext in project devspaces-images by redhat-developer.
the class SshKeysConfiguratorTest method setUp.
@BeforeMethod
public void setUp() throws InfrastructureException, NotFoundException, ServerException {
context = new NamespaceResolutionContext(null, USER_ID, USER_NAME);
kubernetesServer = new KubernetesServer(true, true);
kubernetesServer.before();
when(sshManager.getPairs(USER_ID, "vcs")).thenReturn(Collections.singletonList(sshPair));
when(clientFactory.create()).thenReturn(kubernetesServer.getClient());
}
use of org.eclipse.che.api.workspace.server.spi.NamespaceResolutionContext in project devspaces-images by redhat-developer.
the class UserPreferencesConfiguratorTest method setUp.
@BeforeMethod
public void setUp() throws InfrastructureException, NotFoundException, ServerException {
context = new NamespaceResolutionContext(null, USER_ID, USER_NAME);
kubernetesServer = new KubernetesServer(true, true);
kubernetesServer.before();
Map<String, String> preferences = new HashMap<>();
preferences.put("preference-name", "preference");
lenient().when(userManager.getById(USER_ID)).thenReturn(new UserImpl(USER_ID, USER_EMAIL, USER_NAME));
lenient().when(namespaceFactory.evaluateNamespaceName(any())).thenReturn(USER_NAMESPACE);
lenient().when(clientFactory.create()).thenReturn(kubernetesServer.getClient());
lenient().when(preferenceManager.find(USER_ID)).thenReturn(preferences);
}
Aggregations