Search in sources :

Example 1 with KubernetesConfigsMaps

use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesConfigsMaps in project che-server by eclipse-che.

the class OpenShiftProjectFactoryTest method prepareProject.

private void prepareProject(OpenShiftProject project) throws InfrastructureException {
    KubernetesSecrets secrets = mock(KubernetesSecrets.class);
    lenient().when(project.secrets()).thenReturn(secrets);
    KubernetesConfigsMaps configsMaps = mock(KubernetesConfigsMaps.class);
    Secret secretMock = mock(Secret.class);
    ObjectMeta objectMeta = mock(ObjectMeta.class);
    lenient().when(objectMeta.getName()).thenReturn(CREDENTIALS_SECRET_NAME);
    lenient().when(secretMock.getMetadata()).thenReturn(objectMeta);
    lenient().when(secrets.get()).thenReturn(Collections.singletonList(secretMock));
}
Also used : Secret(io.fabric8.kubernetes.api.model.Secret) ObjectMeta(io.fabric8.kubernetes.api.model.ObjectMeta) KubernetesSecrets(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesSecrets) KubernetesConfigsMaps(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesConfigsMaps)

Example 2 with KubernetesConfigsMaps

use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesConfigsMaps in project devspaces-images by redhat-developer.

the class OpenShiftProjectFactoryTest method prepareProject.

private void prepareProject(OpenShiftProject project) throws InfrastructureException {
    KubernetesSecrets secrets = mock(KubernetesSecrets.class);
    lenient().when(project.secrets()).thenReturn(secrets);
    KubernetesConfigsMaps configsMaps = mock(KubernetesConfigsMaps.class);
    Secret secretMock = mock(Secret.class);
    ObjectMeta objectMeta = mock(ObjectMeta.class);
    lenient().when(objectMeta.getName()).thenReturn(CREDENTIALS_SECRET_NAME);
    lenient().when(secretMock.getMetadata()).thenReturn(objectMeta);
    lenient().when(secrets.get()).thenReturn(Collections.singletonList(secretMock));
}
Also used : Secret(io.fabric8.kubernetes.api.model.Secret) ObjectMeta(io.fabric8.kubernetes.api.model.ObjectMeta) KubernetesSecrets(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesSecrets) KubernetesConfigsMaps(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesConfigsMaps)

Aggregations

ObjectMeta (io.fabric8.kubernetes.api.model.ObjectMeta)2 Secret (io.fabric8.kubernetes.api.model.Secret)2 KubernetesConfigsMaps (org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesConfigsMaps)2 KubernetesSecrets (org.eclipse.che.workspace.infrastructure.kubernetes.namespace.KubernetesSecrets)2