use of org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl in project devspaces-images by redhat-developer.
the class ServerConfigImplTest method testCreateFromEndpointDevfileEndpointAttributeNotSetWhenDefault.
@Test
public void testCreateFromEndpointDevfileEndpointAttributeNotSetWhenDefault() {
ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint(new EndpointImpl("name", 123, new HashMap<>()));
assertFalse(serverConfig.getAttributes().containsKey(REQUIRE_SUBDOMAIN));
}
use of org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl in project devspaces-images by redhat-developer.
the class ServerConfigImplTest method testCreateFromEndpointCustomAttributesShouldPreserveInAttributes.
@Test
public void testCreateFromEndpointCustomAttributesShouldPreserveInAttributes() {
Map<String, String> customAttributes = ImmutableMap.of("k1", "v1", "k2", "v2");
ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint(new EndpointImpl("name", 123, customAttributes));
assertEquals(serverConfig.getAttributes().get("k1"), "v1");
assertEquals(serverConfig.getAttributes().get("k2"), "v2");
assertEquals(serverConfig.getAttributes().size(), 3);
}
use of org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl in project devspaces-images by redhat-developer.
the class ServerConfigImplTest method testCreateFromEndpointTranslatePublicWhatever.
@Test
public void testCreateFromEndpointTranslatePublicWhatever() {
ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint(new EndpointImpl("name", 123, singletonMap("public", "whatever")));
assertFalse(serverConfig.isInternal());
}
use of org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl in project devspaces-images by redhat-developer.
the class ServerConfigImplTest method testCreateFromEndpointMinimalEndpointShouldTranslateToNullPath.
@Test
public void testCreateFromEndpointMinimalEndpointShouldTranslateToNullPath() {
ServerConfig serverConfig = ServerConfigImpl.createFromEndpoint(new EndpointImpl("name", 123, emptyMap()));
assertNull(serverConfig.getPath());
}
use of org.eclipse.che.api.workspace.server.model.impl.devfile.EndpointImpl in project devspaces-images by redhat-developer.
the class DevfileIntegrityValidatorTest method shouldThrowExceptionOnDuplicateEndpointName.
@Test(expectedExceptions = DevfileFormatException.class, expectedExceptionsMessageRegExp = "Duplicated endpoint name 'e1' found in 'dockerimage:latest' component")
public void shouldThrowExceptionOnDuplicateEndpointName() throws Exception {
DevfileImpl broken = new DevfileImpl(initialDevfile);
ComponentImpl component = new ComponentImpl();
component.setType(DOCKERIMAGE_COMPONENT_TYPE);
component.setImage("dockerimage:latest");
component.setEndpoints(ImmutableList.of(new EndpointImpl("e1", 8080, Collections.emptyMap()), new EndpointImpl("e1", 8082, Collections.emptyMap())));
broken.getComponents().add(component);
// when
integrityValidator.validateDevfile(broken);
}
Aggregations