Search in sources :

Example 6 with ProjectInput

use of com.google.gerrit.extensions.api.projects.ProjectInput in project gerrit by GerritCodeReview.

the class CreateProjectIT method createProjectHttpWithNameMismatch_BadRequest.

@Test
public void createProjectHttpWithNameMismatch_BadRequest() throws Exception {
    ProjectInput in = new ProjectInput();
    in.name = name("otherName");
    adminRestSession.put("/projects/" + name("someName"), in).assertBadRequest();
}
Also used : ProjectInput(com.google.gerrit.extensions.api.projects.ProjectInput) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 7 with ProjectInput

use of com.google.gerrit.extensions.api.projects.ProjectInput in project gerrit by GerritCodeReview.

the class CreateProjectIT method createProjectHttpWithInvalidRefName_BadRequest.

@Test
public void createProjectHttpWithInvalidRefName_BadRequest() throws Exception {
    ProjectInput in = new ProjectInput();
    in.branches = Collections.singletonList(name("invalid ref name"));
    adminRestSession.put("/projects/" + name("newProject"), in).assertBadRequest();
}
Also used : ProjectInput(com.google.gerrit.extensions.api.projects.ProjectInput) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 8 with ProjectInput

use of com.google.gerrit.extensions.api.projects.ProjectInput in project gerrit by GerritCodeReview.

the class CreateProjectIT method createProjectWithNonExistingOwner_UnprocessableEntity.

@Test
public void createProjectWithNonExistingOwner_UnprocessableEntity() throws Exception {
    ProjectInput in = new ProjectInput();
    in.name = name("newProjectName");
    in.owners = Collections.singletonList("non-existing-group");
    assertCreateFails(in, UnprocessableEntityException.class);
}
Also used : ProjectInput(com.google.gerrit.extensions.api.projects.ProjectInput) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 9 with ProjectInput

use of com.google.gerrit.extensions.api.projects.ProjectInput in project gerrit by GerritCodeReview.

the class CreateProjectIT method createProjectWithEmptyCommit.

@Test
public void createProjectWithEmptyCommit() throws Exception {
    String newProjectName = name("newProject");
    ProjectInput in = new ProjectInput();
    in.name = newProjectName;
    in.createEmptyCommit = true;
    gApi.projects().create(in);
    assertEmptyCommit(newProjectName, "refs/heads/master");
}
Also used : ProjectInput(com.google.gerrit.extensions.api.projects.ProjectInput) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Example 10 with ProjectInput

use of com.google.gerrit.extensions.api.projects.ProjectInput in project gerrit by GerritCodeReview.

the class CreateProjectIT method createPermissionOnlyProject.

@Test
public void createPermissionOnlyProject() throws Exception {
    String newProjectName = name("newProject");
    ProjectInput in = new ProjectInput();
    in.name = newProjectName;
    in.permissionsOnly = true;
    gApi.projects().create(in);
    assertHead(newProjectName, RefNames.REFS_CONFIG);
}
Also used : ProjectInput(com.google.gerrit.extensions.api.projects.ProjectInput) Test(org.junit.Test) AbstractDaemonTest(com.google.gerrit.acceptance.AbstractDaemonTest)

Aggregations

ProjectInput (com.google.gerrit.extensions.api.projects.ProjectInput)24 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)19 Test (org.junit.Test)19 Project (com.google.gerrit.reviewdb.client.Project)6 ProjectAssert.assertProjectInfo (com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo)3 ProjectInfo (com.google.gerrit.extensions.common.ProjectInfo)3 ResourceConflictException (com.google.gerrit.extensions.restapi.ResourceConflictException)2 AccountGroup (com.google.gerrit.reviewdb.client.AccountGroup)2 PushOneCommit (com.google.gerrit.acceptance.PushOneCommit)1 TestProjectInput (com.google.gerrit.acceptance.TestProjectInput)1 ConfigInput (com.google.gerrit.extensions.api.projects.ConfigInput)1 BadRequestException (com.google.gerrit.extensions.restapi.BadRequestException)1 ResourceNotFoundException (com.google.gerrit.extensions.restapi.ResourceNotFoundException)1 RestApiException (com.google.gerrit.extensions.restapi.RestApiException)1 ProjectConfig (com.google.gerrit.server.git.ProjectConfig)1 PermissionBackendException (com.google.gerrit.server.permissions.PermissionBackendException)1 ProjectState (com.google.gerrit.server.project.ProjectState)1 ProjectCreationValidationListener (com.google.gerrit.server.validators.ProjectCreationValidationListener)1 ValidationException (com.google.gerrit.server.validators.ValidationException)1 ConfigInvalidException (org.eclipse.jgit.errors.ConfigInvalidException)1