use of com.google.gerrit.acceptance.RestResponse in project gerrit by GerritCodeReview.
the class RevisionIT method contentOfParent.
@Test
public void contentOfParent() throws Exception {
String parentContent = "parent content";
PushOneCommit.Result parent = createChange("Parent change", FILE_NAME, parentContent);
parent.assertOkStatus();
gApi.changes().id(parent.getChangeId()).current().review(ReviewInput.approve());
gApi.changes().id(parent.getChangeId()).current().submit();
PushOneCommit.Result child = createChange("Child change", FILE_NAME, FILE_CONTENT);
child.assertOkStatus();
assertContent(child, FILE_NAME, FILE_CONTENT);
RestResponse response = adminRestSession.get("/changes/" + child.getChangeId() + "/revisions/current/files/" + FILE_NAME + "/content?parent=1");
response.assertOK();
assertThat(new String(Base64.decode(response.getEntityContent()), UTF_8)).isEqualTo(parentContent);
}
use of com.google.gerrit.acceptance.RestResponse in project gerrit by GerritCodeReview.
the class SetParentIT method setParentForAllProjects_Conflict.
@Test
public void setParentForAllProjects_Conflict() throws Exception {
RestResponse r = adminRestSession.put("/projects/" + allProjects.get() + "/parent", newParentInput(project.get()));
r.assertConflict();
r.consume();
}
use of com.google.gerrit.acceptance.RestResponse in project gerrit by GerritCodeReview.
the class CreateProjectIT method createProjectHttp.
@Test
public void createProjectHttp() throws Exception {
String newProjectName = name("newProject");
RestResponse r = adminRestSession.put("/projects/" + newProjectName);
r.assertCreated();
ProjectInfo p = newGson().fromJson(r.getReader(), ProjectInfo.class);
assertThat(p.name).isEqualTo(newProjectName);
ProjectState projectState = projectCache.get(new Project.NameKey(newProjectName));
assertThat(projectState).isNotNull();
assertProjectInfo(projectState.getProject(), p);
assertHead(newProjectName, "refs/heads/master");
}
use of com.google.gerrit.acceptance.RestResponse in project gerrit by GerritCodeReview.
the class GarbageCollectionIT method POST.
private RestResponse POST(String endPoint) throws Exception {
RestResponse r = adminRestSession.post(endPoint);
r.consume();
return r;
}
Aggregations