Upgrade Truth to 0.30
IterableSubject is no longer generic, which improves readability in some callers. Change-Id: I948a356089f60f1f02f291a2f433eec67571424b
This commit is contained in:
@@ -31,7 +31,7 @@ public class GroupAssert {
|
|||||||
.that(actual.remove(g)).isTrue();
|
.that(actual.remove(g)).isTrue();
|
||||||
}
|
}
|
||||||
assert_().withFailureMessage("unexpected groups: " + actual)
|
assert_().withFailureMessage("unexpected groups: " + actual)
|
||||||
.that((Iterable<?>)actual).isEmpty();
|
.that(actual).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void assertGroupInfo(AccountGroup group, GroupInfo info) {
|
public static void assertGroupInfo(AccountGroup group, GroupInfo info) {
|
||||||
|
|||||||
@@ -245,10 +245,8 @@ public class HashtagsIT extends AbstractDaemonTest {
|
|||||||
assertMessage(r, "Hashtag added: MyHashtag");
|
assertMessage(r, "Hashtag added: MyHashtag");
|
||||||
}
|
}
|
||||||
|
|
||||||
private IterableSubject<
|
private IterableSubject assertThatGet(PushOneCommit.Result r)
|
||||||
? extends IterableSubject<?, String, Iterable<String>>,
|
throws Exception {
|
||||||
String, Iterable<String>>
|
|
||||||
assertThatGet(PushOneCommit.Result r) throws Exception {
|
|
||||||
return assertThat(gApi.changes()
|
return assertThat(gApi.changes()
|
||||||
.id(r.getChange().getId().get())
|
.id(r.getChange().getId().get())
|
||||||
.getHashtags());
|
.getHashtags());
|
||||||
|
|||||||
@@ -31,12 +31,8 @@ import java.util.List;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class ProjectAssert {
|
public class ProjectAssert {
|
||||||
public static IterableSubject<
|
public static IterableSubject assertThatNameList(
|
||||||
? extends IterableSubject<
|
Iterable<ProjectInfo> actualIt) {
|
||||||
?, Project.NameKey, Iterable<Project.NameKey>>,
|
|
||||||
Project.NameKey,
|
|
||||||
Iterable<Project.NameKey>>
|
|
||||||
assertThatNameList(Iterable<ProjectInfo> actualIt) {
|
|
||||||
List<ProjectInfo> actual = ImmutableList.copyOf(actualIt);
|
List<ProjectInfo> actual = ImmutableList.copyOf(actualIt);
|
||||||
for (ProjectInfo info : actual) {
|
for (ProjectInfo info : actual) {
|
||||||
assertWithMessage("missing project name").that(info.name).isNotNull();
|
assertWithMessage("missing project name").that(info.name).isNotNull();
|
||||||
|
|||||||
@@ -397,7 +397,7 @@ public class CommentsIT extends AbstractDaemonTest {
|
|||||||
setApiUser(admin);
|
setApiUser(admin);
|
||||||
Map<String, List<CommentInfo>> actual =
|
Map<String, List<CommentInfo>> actual =
|
||||||
gApi.changes().id(r1.getChangeId()).drafts();
|
gApi.changes().id(r1.getChangeId()).drafts();
|
||||||
assertThat((Iterable<?>) actual.keySet()).containsExactly(FILE_NAME);
|
assertThat(actual.keySet()).containsExactly(FILE_NAME);
|
||||||
List<CommentInfo> comments = actual.get(FILE_NAME);
|
List<CommentInfo> comments = actual.get(FILE_NAME);
|
||||||
assertThat(comments).hasSize(2);
|
assertThat(comments).hasSize(2);
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,6 @@ public class RepositoryConfigTest {
|
|||||||
RepositoryConfig.OWNER_GROUP_NAME, ownerGroups);
|
RepositoryConfig.OWNER_GROUP_NAME, ownerGroups);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("cast")
|
|
||||||
@Test
|
@Test
|
||||||
public void testBasePathWhenNotConfigured() {
|
public void testBasePathWhenNotConfigured() {
|
||||||
assertThat((Object)repoCfg.getBasePath(new NameKey("someProject"))).isNull();
|
assertThat((Object)repoCfg.getBasePath(new NameKey("someProject"))).isNull();
|
||||||
@@ -159,7 +158,6 @@ public class RepositoryConfigTest {
|
|||||||
.isEqualTo(basePath);
|
.isEqualTo(basePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("cast")
|
|
||||||
@Test
|
@Test
|
||||||
public void testBasePathForSpecificFilter() {
|
public void testBasePathForSpecificFilter() {
|
||||||
String basePath = "/someAbsolutePath/someDirectory";
|
String basePath = "/someAbsolutePath/someDirectory";
|
||||||
|
|||||||
4
lib/BUCK
4
lib/BUCK
@@ -246,8 +246,8 @@ maven_jar(
|
|||||||
|
|
||||||
maven_jar(
|
maven_jar(
|
||||||
name = 'truth',
|
name = 'truth',
|
||||||
id = 'com.google.truth:truth:0.28',
|
id = 'com.google.truth:truth:0.30',
|
||||||
sha1 = '0a388c7877c845ff4b8e19689dda5ac9d34622c4',
|
sha1 = '9d591b5a66eda81f0b88cf1c748ab8853d99b18b',
|
||||||
license = 'DO_NOT_DISTRIBUTE',
|
license = 'DO_NOT_DISTRIBUTE',
|
||||||
exported_deps = [
|
exported_deps = [
|
||||||
':guava',
|
':guava',
|
||||||
|
|||||||
Reference in New Issue
Block a user