use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class BrokerEnvironmentFactoryTest method shouldIncludePluginsVolumeInArtifactsBroker.
@Test
public void shouldIncludePluginsVolumeInArtifactsBroker() throws Exception {
// given
Collection<PluginFQN> pluginFQNs = singletonList(new PluginFQN(null, "id"));
ArgumentCaptor<BrokersConfigs> captor = ArgumentCaptor.forClass(BrokersConfigs.class);
// when
factory.createForArtifactsBroker(pluginFQNs, runtimeId, false);
// then
verify(factory).doCreate(captor.capture());
BrokersConfigs brokersConfigs = captor.getValue();
InternalMachineConfig machine = brokersConfigs.machines.values().iterator().next();
assertTrue(machine.getVolumes().containsKey(PLUGINS_VOLUME_NAME));
assertEquals(machine.getVolumes().get(PLUGINS_VOLUME_NAME).getPath(), "/plugins");
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class BrokerEnvironmentFactoryTest method shouldNotIncludePluginsVolumeInMetadataBroker.
@Test
public void shouldNotIncludePluginsVolumeInMetadataBroker() throws Exception {
// given
Collection<PluginFQN> pluginFQNs = singletonList(new PluginFQN(null, "id"));
ArgumentCaptor<BrokersConfigs> captor = ArgumentCaptor.forClass(BrokersConfigs.class);
// when
factory.createForMetadataBroker(pluginFQNs, runtimeId, false);
// then
verify(factory).doCreate(captor.capture());
BrokersConfigs brokersConfigs = captor.getValue();
InternalMachineConfig machine = brokersConfigs.machines.values().iterator().next();
assertFalse(machine.getVolumes().containsKey(PLUGINS_VOLUME_NAME));
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class EnvVarsConverterTest method setUp.
@BeforeMethod
public void setUp() {
testContainer = new Container();
PodSpec podSpec = new PodSpec();
podSpec.setContainers(singletonList(testContainer));
ObjectMeta podMeta = new ObjectMeta();
podMeta.setName("pod");
Pod pod = new Pod();
pod.setSpec(podSpec);
pod.setMetadata(podMeta);
Map<String, Pod> pods = new HashMap<>();
pods.put("pod", pod);
environment = KubernetesEnvironment.builder().setPods(pods).build();
machine = new InternalMachineConfig();
environment.setMachines(Collections.singletonMap(Names.machineName(podMeta, testContainer), machine));
identity = new RuntimeIdentityImpl("wsId", "blah", "bleh", "infraNamespace");
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class KubernetesPluginsToolingApplierTest method addsMachineWithServersForContainer.
@Test
public void addsMachineWithServersForContainer() throws Exception {
// given
ChePlugin chePlugin = createChePlugin();
addPortToSingleContainerPlugin(chePlugin, 80, "test-port", emptyMap(), true);
// when
applier.apply(runtimeIdentity, internalEnvironment, singletonList(chePlugin));
// then
InternalMachineConfig machineConfig = getOneAndOnlyNonUserMachine(internalEnvironment);
assertEquals(machineConfig.getServers(), expectedSingleServer(80, "test-port", emptyMap(), true));
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class KubernetesPluginsToolingApplierTest method addsMachineWithServersThatSetProtocolAndPath.
@Test
public void addsMachineWithServersThatSetProtocolAndPath() throws Exception {
// given
ChePlugin chePlugin = createChePlugin();
addPortToSingleContainerPlugin(chePlugin, 443, "test-port", ImmutableMap.of("path", "/path/1", "protocol", "https", "attr1", "value1"), true);
// when
applier.apply(runtimeIdentity, internalEnvironment, singletonList(chePlugin));
// then
InternalMachineConfig machineConfig = getOneAndOnlyNonUserMachine(internalEnvironment);
assertEquals(machineConfig.getServers(), expectedSingleServer(443, "test-port", singletonMap("attr1", "value1"), true, "https", "/path/1"));
}
Aggregations