Search in sources :

Example 26 with ProjectConfig

use of org.eclipse.che.api.core.model.project.ProjectConfig in project che by eclipse.

the class WorkspaceServiceTest method shouldDeleteProject.

@Test
public void shouldDeleteProject() throws Exception {
    final WorkspaceImpl workspace = createWorkspace(createConfigDto());
    when(wsManager.getWorkspace(workspace.getId())).thenReturn(workspace);
    final ProjectConfig firstProject = workspace.getConfig().getProjects().iterator().next();
    final Response response = given().auth().basic(ADMIN_USER_NAME, ADMIN_USER_PASSWORD).when().delete(SECURE_PATH + "/workspace/" + workspace.getId() + "/project" + firstProject.getPath());
    assertEquals(response.getStatusCode(), 204);
    verify(wsManager).updateWorkspace(any(), any());
}
Also used : ProjectConfig(org.eclipse.che.api.core.model.project.ProjectConfig) Response(com.jayway.restassured.response.Response) WorkspaceImpl(org.eclipse.che.api.workspace.server.model.impl.WorkspaceImpl) Test(org.testng.annotations.Test)

Aggregations

ProjectConfig (org.eclipse.che.api.core.model.project.ProjectConfig)26 NewProjectConfig (org.eclipse.che.api.core.model.project.NewProjectConfig)20 Test (org.junit.Test)17 ArrayList (java.util.ArrayList)12 HashMap (java.util.HashMap)7 List (java.util.List)7 ConflictException (org.eclipse.che.api.core.ConflictException)6 AttributeValue (org.eclipse.che.api.project.server.type.AttributeValue)6 NotFoundException (org.eclipse.che.api.core.NotFoundException)5 Problem (org.eclipse.che.api.project.server.RegisteredProject.Problem)5 ForbiddenException (org.eclipse.che.api.core.ForbiddenException)3 ServerException (org.eclipse.che.api.core.ServerException)3 ProjectTypeRegistry (org.eclipse.che.api.project.server.type.ProjectTypeRegistry)3 File (java.io.File)2 IOException (java.io.IOException)2 BadRequestException (org.eclipse.che.api.core.BadRequestException)2 UnauthorizedException (org.eclipse.che.api.core.UnauthorizedException)2 SourceStorage (org.eclipse.che.api.core.model.project.SourceStorage)2 ProjectHandlerRegistry (org.eclipse.che.api.project.server.handlers.ProjectHandlerRegistry)2 ProjectImporter (org.eclipse.che.api.project.server.importer.ProjectImporter)2