Introduce Google Truth in acceptance tests
"Truth is a testing framework designed to make your tests and their error messages more readable and discoverable, while being extensible to new types of objects." http://google.github.io/truth/ Add dependency on Truth and convert some of the acceptance tests to use it. Change-Id: Ie80c08391f7b48e504db2a4bbe78cba7bbe85cef Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
committed by
Edwin Kempin
parent
c31a38172a
commit
1fcca1b60a
@@ -26,6 +26,7 @@ java_library(
|
||||
'//lib:jsch',
|
||||
'//lib:junit',
|
||||
'//lib:servlet-api-3_1',
|
||||
'//lib:truth',
|
||||
|
||||
'//lib/hamcrest:hamcrest-core',
|
||||
'//lib/hamcrest:hamcrest-library',
|
||||
|
||||
@@ -14,12 +14,11 @@
|
||||
|
||||
package com.google.gerrit.acceptance;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.gerrit.acceptance.GitUtil.add;
|
||||
import static com.google.gerrit.acceptance.GitUtil.amendCommit;
|
||||
import static com.google.gerrit.acceptance.GitUtil.createCommit;
|
||||
import static com.google.gerrit.acceptance.GitUtil.pushHead;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Strings;
|
||||
@@ -226,9 +225,9 @@ public class PushOneCommit {
|
||||
throws OrmException {
|
||||
Change c =
|
||||
Iterables.getOnlyElement(db.changes().byKey(new Change.Key(commit.getChangeId())).toList());
|
||||
assertEquals(resSubj, c.getSubject());
|
||||
assertEquals(expectedStatus, c.getStatus());
|
||||
assertEquals(expectedTopic, Strings.emptyToNull(c.getTopic()));
|
||||
assertThat(resSubj).isEqualTo(c.getSubject());
|
||||
assertThat(expectedStatus).isEqualTo(c.getStatus());
|
||||
assertThat(expectedTopic).isEqualTo(Strings.emptyToNull(c.getTopic()));
|
||||
assertReviewers(c, expectedReviewers);
|
||||
}
|
||||
|
||||
@@ -245,11 +244,13 @@ public class PushOneCommit {
|
||||
|
||||
for (Account.Id accountId
|
||||
: approvalsUtil.getReviewers(db, notesFactory.create(c)).values()) {
|
||||
assertTrue("unexpected reviewer " + accountId,
|
||||
expectedReviewerIds.remove(accountId));
|
||||
assertThat(expectedReviewerIds.remove(accountId))
|
||||
.named("unexpected reviewer " + accountId)
|
||||
.isTrue();
|
||||
}
|
||||
assertTrue("missing reviewers: " + expectedReviewerIds,
|
||||
expectedReviewerIds.isEmpty());
|
||||
assertThat(expectedReviewerIds.isEmpty())
|
||||
.named("missing reviewers: " + expectedReviewerIds)
|
||||
.isTrue();
|
||||
}
|
||||
|
||||
public void assertOkStatus() {
|
||||
@@ -262,15 +263,17 @@ public class PushOneCommit {
|
||||
|
||||
private void assertStatus(Status expectedStatus, String expectedMessage) {
|
||||
RemoteRefUpdate refUpdate = result.getRemoteUpdate(ref);
|
||||
assertEquals(message(refUpdate),
|
||||
expectedStatus, refUpdate.getStatus());
|
||||
assertEquals(expectedMessage, refUpdate.getMessage());
|
||||
assertThat(expectedStatus)
|
||||
.named(message(refUpdate))
|
||||
.isEqualTo(refUpdate.getStatus());
|
||||
assertThat(expectedMessage).isEqualTo(refUpdate.getMessage());
|
||||
}
|
||||
|
||||
public void assertMessage(String expectedMessage) {
|
||||
RemoteRefUpdate refUpdate = result.getRemoteUpdate(ref);
|
||||
assertTrue(message(refUpdate), message(refUpdate).toLowerCase().contains(
|
||||
expectedMessage.toLowerCase()));
|
||||
assertThat(message(refUpdate).toLowerCase())
|
||||
.named(message(refUpdate))
|
||||
.contains(expectedMessage.toLowerCase());
|
||||
}
|
||||
|
||||
private String message(RemoteRefUpdate refUpdate) {
|
||||
|
||||
@@ -14,10 +14,7 @@
|
||||
|
||||
package com.google.gerrit.acceptance.api.change;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Iterables;
|
||||
@@ -51,15 +48,15 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
PushOneCommit.Result r = createChange();
|
||||
String triplet = "p~master~" + r.getChangeId();
|
||||
ChangeInfo c = info(triplet);
|
||||
assertEquals(triplet, c.id);
|
||||
assertEquals("p", c.project);
|
||||
assertEquals("master", c.branch);
|
||||
assertEquals(ChangeStatus.NEW, c.status);
|
||||
assertEquals("test commit", c.subject);
|
||||
assertEquals(true, c.mergeable);
|
||||
assertEquals(r.getChangeId(), c.changeId);
|
||||
assertEquals(c.created, c.updated);
|
||||
assertEquals(1, c._number);
|
||||
assertThat(c.id).isEqualTo(triplet);
|
||||
assertThat(c.project).isEqualTo("p");
|
||||
assertThat(c.branch).isEqualTo("master");
|
||||
assertThat(c.status).isEqualTo(ChangeStatus.NEW);
|
||||
assertThat(c.subject).isEqualTo("test commit");
|
||||
assertThat(c.mergeable).isTrue();
|
||||
assertThat(c.changeId).isEqualTo(r.getChangeId());
|
||||
assertThat(c.created).isEqualTo(c.updated);
|
||||
assertThat(c._number).is(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -126,7 +123,8 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
gApi.changes()
|
||||
.id(r.getChangeId())
|
||||
.addReviewer(in);
|
||||
assertEquals(ImmutableSet.of(user.id), getReviewers(r.getChangeId()));
|
||||
assertThat(getReviewers(r.getChangeId()))
|
||||
.containsExactlyElementsIn(ImmutableSet.of(user.id));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -141,15 +139,16 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
.revision(r.getCommit().name())
|
||||
.submit();
|
||||
|
||||
assertEquals(ImmutableSet.of(admin.getId()), getReviewers(r.getChangeId()));
|
||||
assertThat(getReviewers(r.getChangeId()))
|
||||
.containsExactlyElementsIn(ImmutableSet.of(admin.getId()));
|
||||
|
||||
AddReviewerInput in = new AddReviewerInput();
|
||||
in.reviewer = user.email;
|
||||
gApi.changes()
|
||||
.id(r.getChangeId())
|
||||
.addReviewer(in);
|
||||
assertEquals(ImmutableSet.of(admin.getId(), user.id),
|
||||
getReviewers(r.getChangeId()));
|
||||
assertThat(getReviewers(r.getChangeId()))
|
||||
.containsExactlyElementsIn(ImmutableSet.of(admin.getId(), user.id));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -162,9 +161,9 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
.changes()
|
||||
.create(in)
|
||||
.get();
|
||||
assertEquals(in.project, info.project);
|
||||
assertEquals(in.branch, info.branch);
|
||||
assertEquals(in.subject, info.subject);
|
||||
assertThat(info.project).isEqualTo(in.project);
|
||||
assertThat(info.branch).isEqualTo(in.branch);
|
||||
assertThat(info.subject).isEqualTo(in.subject);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -172,18 +171,18 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
PushOneCommit.Result r1 = createChange();
|
||||
PushOneCommit.Result r2 = createChange();
|
||||
List<ChangeInfo> results = gApi.changes().query().get();
|
||||
assertEquals(2, results.size());
|
||||
assertEquals(r2.getChangeId(), results.get(0).changeId);
|
||||
assertEquals(r1.getChangeId(), results.get(1).changeId);
|
||||
assertThat(results.size()).is(2);
|
||||
assertThat(results.get(0).changeId).isEqualTo(r2.getChangeId());
|
||||
assertThat(results.get(1).changeId).isEqualTo(r1.getChangeId());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryChangesNoResults() throws Exception {
|
||||
createChange();
|
||||
List<ChangeInfo> results = query("status:open");
|
||||
assertEquals(1, results.size());
|
||||
assertThat(results.size()).is(1);
|
||||
results = query("status:closed");
|
||||
assertTrue(results.isEmpty());
|
||||
assertThat(results.isEmpty()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -191,9 +190,9 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
PushOneCommit.Result r1 = createChange();
|
||||
PushOneCommit.Result r2 = createChange();
|
||||
List<ChangeInfo> results = query("status:open");
|
||||
assertEquals(2, results.size());
|
||||
assertEquals(r2.getChangeId(), results.get(0).changeId);
|
||||
assertEquals(r1.getChangeId(), results.get(1).changeId);
|
||||
assertThat(results.size()).is(2);
|
||||
assertThat(results.get(0).changeId).isEqualTo(r2.getChangeId());
|
||||
assertThat(results.get(1).changeId).isEqualTo(r1.getChangeId());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -201,7 +200,8 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
PushOneCommit.Result r1 = createChange();
|
||||
createChange();
|
||||
List<ChangeInfo> results = query("status:open " + r1.getChangeId());
|
||||
assertEquals(r1.getChangeId(), Iterables.getOnlyElement(results).changeId);
|
||||
assertThat(Iterables.getOnlyElement(results).changeId)
|
||||
.isEqualTo(r1.getChangeId());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -209,8 +209,9 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
createChange();
|
||||
PushOneCommit.Result r2 = createChange();
|
||||
List<ChangeInfo> results = gApi.changes().query().withLimit(1).get();
|
||||
assertEquals(1, results.size());
|
||||
assertEquals(r2.getChangeId(), Iterables.getOnlyElement(results).changeId);
|
||||
assertThat(results.size()).is(1);
|
||||
assertThat(Iterables.getOnlyElement(results).changeId)
|
||||
.isEqualTo(r2.getChangeId());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -218,17 +219,18 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
PushOneCommit.Result r1 = createChange();
|
||||
createChange();
|
||||
List<ChangeInfo> results = gApi.changes().query().withStart(1).get();
|
||||
assertEquals(r1.getChangeId(), Iterables.getOnlyElement(results).changeId);
|
||||
assertThat(Iterables.getOnlyElement(results).changeId)
|
||||
.isEqualTo(r1.getChangeId());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryChangesNoOptions() throws Exception {
|
||||
PushOneCommit.Result r = createChange();
|
||||
ChangeInfo result = Iterables.getOnlyElement(query(r.getChangeId()));
|
||||
assertNull(result.labels);
|
||||
assertNull(result.messages);
|
||||
assertNull(result.revisions);
|
||||
assertNull(result.actions);
|
||||
assertThat(result.labels).isNull();
|
||||
assertThat(result.messages).isNull();
|
||||
assertThat(result.revisions).isNull();
|
||||
assertThat(result.actions).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -238,23 +240,23 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
.query(r.getChangeId())
|
||||
.withOptions(EnumSet.allOf(ListChangesOption.class))
|
||||
.get());
|
||||
assertEquals("Code-Review",
|
||||
Iterables.getOnlyElement(result.labels.keySet()));
|
||||
assertEquals(1, result.messages.size());
|
||||
assertFalse(result.actions.isEmpty());
|
||||
assertThat(Iterables.getOnlyElement(result.labels.keySet()))
|
||||
.isEqualTo("Code-Review");
|
||||
assertThat(result.messages.size()).is(1);
|
||||
assertThat(result.actions.isEmpty()).isFalse();
|
||||
|
||||
RevisionInfo rev = Iterables.getOnlyElement(result.revisions.values());
|
||||
assertEquals(r.getPatchSetId().get(), rev._number);
|
||||
assertFalse(rev.actions.isEmpty());
|
||||
assertThat(rev._number).isEqualTo(r.getPatchSetId().get());
|
||||
assertThat(rev.actions.isEmpty()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryChangesOwnerWithDifferentUsers() throws Exception {
|
||||
PushOneCommit.Result r = createChange();
|
||||
assertEquals(r.getChangeId(),
|
||||
Iterables.getOnlyElement(query("owner:self")).changeId);
|
||||
assertThat(Iterables.getOnlyElement(query("owner:self")).changeId)
|
||||
.isEqualTo(r.getChangeId());
|
||||
setApiUser(user);
|
||||
assertTrue(query("owner:self").isEmpty());
|
||||
assertThat(query("owner:self").isEmpty()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -267,29 +269,29 @@ public class ChangeIT extends AbstractDaemonTest {
|
||||
.addReviewer(in);
|
||||
|
||||
setApiUser(user);
|
||||
assertNull(get(r.getChangeId()).reviewed);
|
||||
assertThat(get(r.getChangeId()).reviewed).isNull();
|
||||
|
||||
revision(r).review(ReviewInput.recommend());
|
||||
assertTrue(get(r.getChangeId()).reviewed);
|
||||
assertThat(get(r.getChangeId()).reviewed).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void topic() throws Exception {
|
||||
PushOneCommit.Result r = createChange();
|
||||
assertEquals("", gApi.changes()
|
||||
assertThat(gApi.changes()
|
||||
.id(r.getChangeId())
|
||||
.topic());
|
||||
.topic()).isEqualTo("");
|
||||
gApi.changes()
|
||||
.id(r.getChangeId())
|
||||
.topic("mytopic");
|
||||
assertEquals("mytopic", gApi.changes()
|
||||
assertThat(gApi.changes()
|
||||
.id(r.getChangeId())
|
||||
.topic());
|
||||
.topic()).isEqualTo("mytopic");
|
||||
gApi.changes()
|
||||
.id(r.getChangeId())
|
||||
.topic("");
|
||||
assertEquals("", gApi.changes()
|
||||
assertThat(gApi.changes()
|
||||
.id(r.getChangeId())
|
||||
.topic());
|
||||
.topic()).isEqualTo("");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,10 +14,8 @@
|
||||
|
||||
package com.google.gerrit.acceptance.api.project;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
import com.google.gerrit.acceptance.AbstractDaemonTest;
|
||||
import com.google.gerrit.acceptance.NoHttpd;
|
||||
@@ -38,7 +36,7 @@ public class ProjectIT extends AbstractDaemonTest {
|
||||
@Test
|
||||
public void createProjectFoo() throws Exception {
|
||||
String name = "foo";
|
||||
assertEquals(name,
|
||||
assertThat(name).isEqualTo(
|
||||
gApi.projects()
|
||||
.name(name)
|
||||
.create()
|
||||
@@ -84,36 +82,36 @@ public class ProjectIT extends AbstractDaemonTest {
|
||||
gApi.projects().name("bar").create();
|
||||
|
||||
List<ProjectInfo> allProjects = gApi.projects().list().get();
|
||||
assertEquals(initialProjects.size() + 2, allProjects.size());
|
||||
assertThat(allProjects.size()).is(initialProjects.size() + 2);
|
||||
|
||||
List<ProjectInfo> projectsWithDescription = gApi.projects().list()
|
||||
.withDescription(true)
|
||||
.get();
|
||||
assertNotNull(projectsWithDescription.get(0).description);
|
||||
assertThat(projectsWithDescription.get(0).description).isNotNull();
|
||||
|
||||
List<ProjectInfo> projectsWithoutDescription = gApi.projects().list()
|
||||
.withDescription(false)
|
||||
.get();
|
||||
assertNull(projectsWithoutDescription.get(0).description);
|
||||
assertThat(projectsWithoutDescription.get(0).description).isNull();
|
||||
|
||||
List<ProjectInfo> noMatchingProjects = gApi.projects().list()
|
||||
.withPrefix("fox")
|
||||
.get();
|
||||
assertEquals(0, noMatchingProjects.size());
|
||||
assertThat(noMatchingProjects.size()).is(0);
|
||||
|
||||
List<ProjectInfo> matchingProject = gApi.projects().list()
|
||||
.withPrefix("fo")
|
||||
.get();
|
||||
assertEquals(1, matchingProject.size());
|
||||
assertThat(matchingProject.size()).is(1);
|
||||
|
||||
List<ProjectInfo> limitOneProject = gApi.projects().list()
|
||||
.withLimit(1)
|
||||
.get();
|
||||
assertEquals(1, limitOneProject.size());
|
||||
assertThat(limitOneProject.size()).is(1);
|
||||
|
||||
List<ProjectInfo> startAtOneProjects = gApi.projects().list()
|
||||
.withStart(1)
|
||||
.get();
|
||||
assertEquals(allProjects.size() - 1, startAtOneProjects.size());
|
||||
assertThat(startAtOneProjects.size()).is(allProjects.size() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
|
||||
package com.google.gerrit.acceptance.api.revision;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
@@ -132,13 +130,13 @@ public class RevisionIT extends AbstractDaemonTest {
|
||||
ChangeApi orig = gApi.changes()
|
||||
.id("p~master~" + r.getChangeId());
|
||||
|
||||
assertEquals(1, orig.get().messages.size());
|
||||
assertThat(orig.get().messages.size()).is(1);
|
||||
ChangeApi cherry = orig.revision(r.getCommit().name())
|
||||
.cherryPick(in);
|
||||
assertEquals(2, orig.get().messages.size());
|
||||
assertThat(orig.get().messages.size()).is(2);
|
||||
|
||||
assertTrue(cherry.get().subject.contains(in.message));
|
||||
assertEquals("someTopic", cherry.get().topic);
|
||||
assertThat(cherry.get().subject).contains(in.message);
|
||||
assertThat(cherry.get().topic).isEqualTo("someTopic");
|
||||
cherry.current().review(ReviewInput.approve());
|
||||
cherry.current().submit();
|
||||
}
|
||||
@@ -156,12 +154,12 @@ public class RevisionIT extends AbstractDaemonTest {
|
||||
ChangeApi orig = gApi.changes()
|
||||
.id("p~master~" + r.getChangeId());
|
||||
|
||||
assertEquals(1, orig.get().messages.size());
|
||||
assertThat(orig.get().messages.size()).is(1);
|
||||
ChangeApi cherry = orig.revision(r.getCommit().name())
|
||||
.cherryPick(in);
|
||||
assertEquals(2, orig.get().messages.size());
|
||||
assertThat(orig.get().messages.size()).is(2);
|
||||
|
||||
assertTrue(cherry.get().subject.contains(in.message));
|
||||
assertThat(cherry.get().subject).contains(in.message);
|
||||
cherry.current().review(ReviewInput.approve());
|
||||
cherry.current().submit();
|
||||
|
||||
@@ -169,7 +167,7 @@ public class RevisionIT extends AbstractDaemonTest {
|
||||
orig.revision(r.getCommit().name()).cherryPick(in);
|
||||
fail("Cherry-pick identical tree error expected");
|
||||
} catch (RestApiException e) {
|
||||
assertEquals("Cherry pick failed: identical tree", e.getMessage());
|
||||
assertThat(e.getMessage()).isEqualTo("Cherry pick failed: identical tree");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,13 +188,13 @@ public class RevisionIT extends AbstractDaemonTest {
|
||||
push.to(git, "refs/heads/foo");
|
||||
|
||||
ChangeApi orig = gApi.changes().id("p~master~" + r.getChangeId());
|
||||
assertEquals(1, orig.get().messages.size());
|
||||
assertThat(orig.get().messages.size()).is(1);
|
||||
|
||||
try {
|
||||
orig.revision(r.getCommit().name()).cherryPick(in);
|
||||
fail("Cherry-pick merge conflict error expected");
|
||||
} catch (RestApiException e) {
|
||||
assertEquals("Cherry pick failed: merge conflict", e.getMessage());
|
||||
assertThat(e.getMessage()).isEqualTo("Cherry pick failed: merge conflict");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,20 +206,22 @@ public class RevisionIT extends AbstractDaemonTest {
|
||||
|
||||
push = pushFactory.create(db, admin.getIdent());
|
||||
PushOneCommit.Result r2 = push.to(git, "refs/for/master");
|
||||
assertFalse(gApi.changes()
|
||||
boolean canRebase = gApi.changes()
|
||||
.id(r2.getChangeId())
|
||||
.revision(r2.getCommit().name())
|
||||
.canRebase());
|
||||
.canRebase();
|
||||
assertThat(canRebase).isFalse();
|
||||
merge(r2);
|
||||
|
||||
git.checkout().setName(r1.getCommit().name()).call();
|
||||
push = pushFactory.create(db, admin.getIdent());
|
||||
PushOneCommit.Result r3 = push.to(git, "refs/for/master");
|
||||
|
||||
assertTrue(gApi.changes()
|
||||
canRebase = gApi.changes()
|
||||
.id(r3.getChangeId())
|
||||
.revision(r3.getCommit().name())
|
||||
.canRebase());
|
||||
.canRebase();
|
||||
assertThat(canRebase).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -234,24 +234,23 @@ public class RevisionIT extends AbstractDaemonTest {
|
||||
.current()
|
||||
.setReviewed(PushOneCommit.FILE_NAME, true);
|
||||
|
||||
assertEquals(PushOneCommit.FILE_NAME,
|
||||
Iterables.getOnlyElement(
|
||||
assertThat(Iterables.getOnlyElement(
|
||||
gApi.changes()
|
||||
.id(r.getChangeId())
|
||||
.current()
|
||||
.reviewed()));
|
||||
.reviewed())).isEqualTo(PushOneCommit.FILE_NAME);
|
||||
|
||||
gApi.changes()
|
||||
.id(r.getChangeId())
|
||||
.current()
|
||||
.setReviewed(PushOneCommit.FILE_NAME, false);
|
||||
|
||||
assertTrue(
|
||||
gApi.changes()
|
||||
.id(r.getChangeId())
|
||||
.current()
|
||||
.reviewed()
|
||||
.isEmpty());
|
||||
boolean isEmpty = gApi.changes()
|
||||
.id(r.getChangeId())
|
||||
.current()
|
||||
.reviewed()
|
||||
.isEmpty() ;
|
||||
assertThat(isEmpty).isTrue();
|
||||
}
|
||||
|
||||
private void merge(PushOneCommit.Result r) throws Exception {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
package com.google.gerrit.acceptance.rest.change;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import com.google.common.base.CharMatcher;
|
||||
import com.google.common.base.Splitter;
|
||||
@@ -45,9 +45,9 @@ public class HashtagsIT extends AbstractDaemonTest {
|
||||
|
||||
private void assertResult(RestResponse r, List<String> expected)
|
||||
throws IOException {
|
||||
assertEquals(HttpStatus.SC_OK, r.getStatusCode());
|
||||
assertThat(r.getStatusCode()).isEqualTo(HttpStatus.SC_OK);
|
||||
List<String> result = toHashtagList(r);
|
||||
assertEquals(expected, result);
|
||||
assertThat(result).containsExactlyElementsIn(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
11
lib/BUCK
11
lib/BUCK
@@ -177,6 +177,17 @@ maven_jar(
|
||||
deps = ['//lib/hamcrest:hamcrest-core'],
|
||||
)
|
||||
|
||||
maven_jar(
|
||||
name = 'truth',
|
||||
id = 'com.google.truth:truth:0.24',
|
||||
sha1 = '7f70cea641f8812179c60162cb38354e81a459ae',
|
||||
license = 'DO_NOT_DISTRIBUTE',
|
||||
deps = [
|
||||
':guava',
|
||||
':junit',
|
||||
],
|
||||
)
|
||||
|
||||
maven_jar(
|
||||
name = 'tukaani-xz',
|
||||
id = 'org.tukaani:xz:1.4',
|
||||
|
||||
Reference in New Issue
Block a user