use of org.eclipse.che.api.workspace.server.devfile.FileContentProvider in project devspaces-images by redhat-developer.
the class DevfileConverterTest method shouldConvertComponentsDuringConvertingDevfileToWorkspaceConfig.
@Test
public void shouldConvertComponentsDuringConvertingDevfileToWorkspaceConfig() throws Exception {
// given
DevfileImpl devfile = newDevfile("petclinic");
ComponentImpl component = new ComponentImpl();
component.setType(COMPONENT_TYPE);
devfile.getComponents().add(component);
FileContentProvider fileContentProvider = mock(FileContentProvider.class);
// when
WorkspaceConfigImpl workspaceConfig = devfileConverter.devFileToWorkspaceConfig(devfile, fileContentProvider);
// then
verify(componentToWorkspaceApplier).apply(workspaceConfig, component, fileContentProvider);
}
use of org.eclipse.che.api.workspace.server.devfile.FileContentProvider in project devspaces-images by redhat-developer.
the class DevfileConverterTest method shouldInvokeDefaultEditorProvisionerDuringConvertingDevfileToWorkrspaceConfig.
@Test
public void shouldInvokeDefaultEditorProvisionerDuringConvertingDevfileToWorkrspaceConfig() throws Exception {
// given
FileContentProvider fileContentProvider = mock(FileContentProvider.class);
DevfileImpl devfile = newDevfile("petclinic");
// when
devfileConverter.devFileToWorkspaceConfig(devfile, fileContentProvider);
// then
verify(defaultEditorToolApplier).apply(devfile, fileContentProvider);
}
use of org.eclipse.che.api.workspace.server.devfile.FileContentProvider in project devspaces-images by redhat-developer.
the class DevfileConverterTest method shouldConvertProjectsDuringConvertingDevfileToWorkspaceConfig.
@Test
public void shouldConvertProjectsDuringConvertingDevfileToWorkspaceConfig() throws Exception {
// given
FileContentProvider fileContentProvider = mock(FileContentProvider.class);
DevfileImpl devfile = newDevfile("petclinic");
ProjectImpl devfileProject = mock(ProjectImpl.class);
devfile.getProjects().add(devfileProject);
ProjectConfigImpl workspaceProject = mock(ProjectConfigImpl.class);
when(projectConverter.toWorkspaceProject(any())).thenReturn(workspaceProject);
// when
WorkspaceConfigImpl workspaceConfig = devfileConverter.devFileToWorkspaceConfig(devfile, fileContentProvider);
// then
assertEquals(workspaceConfig.getProjects().size(), 1);
assertSame(workspaceConfig.getProjects().get(0), workspaceProject);
}
Aggregations