Don't use Subject#named anymore
Subject#named is being removed. As recommended, migrate from assertThat(foo).named("foo") to assertWithMessage("foo").that(foo). Change-Id: Ie5266c993dcd96270db07ff399c1e4877f71718c
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
package com.google.gerrit.acceptance.ssh;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth.assertWithMessage;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.gerrit.acceptance.AbstractDaemonTest;
|
||||
@@ -294,8 +295,8 @@ public class QueryIT extends AbstractDaemonTest {
|
||||
// computation while formatting the output, such as labels, reviewers etc.
|
||||
merge(r);
|
||||
for (ListChangesOption option : ListChangesOption.values()) {
|
||||
assertThat(gApi.changes().query(r.getChangeId()).withOption(option).get())
|
||||
.named("Option: " + option)
|
||||
assertWithMessage("Option: " + option)
|
||||
.that(gApi.changes().query(r.getChangeId()).withOption(option).get())
|
||||
.hasSize(1);
|
||||
}
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@
|
||||
package com.google.gerrit.metrics.proc;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static com.google.common.truth.Truth.assertWithMessage;
|
||||
import static com.google.gerrit.testing.GerritJUnit.assertThrows;
|
||||
|
||||
import com.codahale.metrics.Counter;
|
||||
@@ -166,8 +167,8 @@ public class ProcMetricModuleTest {
|
||||
|
||||
private <M extends Metric> M get(String name, Class<M> type) {
|
||||
Metric m = registry.getMetrics().get(name);
|
||||
assertThat(m).named(name).isNotNull();
|
||||
assertThat(m).named(name).isInstanceOf(type);
|
||||
assertWithMessage(name).that(m).isNotNull();
|
||||
assertWithMessage(name).that(m).isInstanceOf(type);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
M result = (M) m;
|
||||
|
Reference in New Issue
Block a user