Custom Truth subjects: Align name passed to Subject#check with reality
In order to print a nice failure message which matches the reality of the asserted objects, use the real name of the called method or property if it makes sense. When the assertion is on a derivative of a method or property or when the real name isn't helpful for a failure message (e.g. "ab" naming of common lines for diffs), keep using more descriptive pseudo-method names. Change-Id: I53fae276c57fe09fb43a58e77efd681b34b60eb7
This commit is contained in:
@@ -40,12 +40,12 @@ public class GroupReferenceSubject extends Subject<GroupReferenceSubject, GroupR
|
|||||||
public ComparableSubject<?, AccountGroup.UUID> groupUuid() {
|
public ComparableSubject<?, AccountGroup.UUID> groupUuid() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
GroupReference group = actual();
|
GroupReference group = actual();
|
||||||
return check("groupUuid()").that(group.getUUID());
|
return check("getUUID()").that(group.getUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringSubject name() {
|
public StringSubject name() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
GroupReference group = actual();
|
GroupReference group = actual();
|
||||||
return check("name()").that(group.getName());
|
return check("getName()").that(group.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -41,25 +41,25 @@ public class CommitInfoSubject extends Subject<CommitInfoSubject, CommitInfo> {
|
|||||||
public StringSubject commit() {
|
public StringSubject commit() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
CommitInfo commitInfo = actual();
|
CommitInfo commitInfo = actual();
|
||||||
return check("commit()").that(commitInfo.commit);
|
return check("commit").that(commitInfo.commit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ListSubject<CommitInfoSubject, CommitInfo> parents() {
|
public ListSubject<CommitInfoSubject, CommitInfo> parents() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
CommitInfo commitInfo = actual();
|
CommitInfo commitInfo = actual();
|
||||||
return check("parents()").about(elements()).thatCustom(commitInfo.parents, commits());
|
return check("parents").about(elements()).thatCustom(commitInfo.parents, commits());
|
||||||
}
|
}
|
||||||
|
|
||||||
public GitPersonSubject committer() {
|
public GitPersonSubject committer() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
CommitInfo commitInfo = actual();
|
CommitInfo commitInfo = actual();
|
||||||
return check("committer()").about(gitPersons()).that(commitInfo.committer);
|
return check("committer").about(gitPersons()).that(commitInfo.committer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GitPersonSubject author() {
|
public GitPersonSubject author() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
CommitInfo commitInfo = actual();
|
CommitInfo commitInfo = actual();
|
||||||
return check("author()").about(gitPersons()).that(commitInfo.author);
|
return check("author").about(gitPersons()).that(commitInfo.author);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringSubject message() {
|
public StringSubject message() {
|
||||||
|
@@ -39,7 +39,7 @@ public class DiffInfoSubject extends Subject<DiffInfoSubject, DiffInfo> {
|
|||||||
public ListSubject<ContentEntrySubject, ContentEntry> content() {
|
public ListSubject<ContentEntrySubject, ContentEntry> content() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
DiffInfo diffInfo = actual();
|
DiffInfo diffInfo = actual();
|
||||||
return check("content()")
|
return check("content")
|
||||||
.about(elements())
|
.about(elements())
|
||||||
.thatCustom(diffInfo.content, ContentEntrySubject.contentEntries());
|
.thatCustom(diffInfo.content, ContentEntrySubject.contentEntries());
|
||||||
}
|
}
|
||||||
@@ -47,18 +47,18 @@ public class DiffInfoSubject extends Subject<DiffInfoSubject, DiffInfo> {
|
|||||||
public ComparableSubject<?, ChangeType> changeType() {
|
public ComparableSubject<?, ChangeType> changeType() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
DiffInfo diffInfo = actual();
|
DiffInfo diffInfo = actual();
|
||||||
return check("changeType()").that(diffInfo.changeType);
|
return check("changeType").that(diffInfo.changeType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileMetaSubject metaA() {
|
public FileMetaSubject metaA() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
DiffInfo diffInfo = actual();
|
DiffInfo diffInfo = actual();
|
||||||
return check("metaA()").about(fileMetas()).that(diffInfo.metaA);
|
return check("metaA").about(fileMetas()).that(diffInfo.metaA);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileMetaSubject metaB() {
|
public FileMetaSubject metaB() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
DiffInfo diffInfo = actual();
|
DiffInfo diffInfo = actual();
|
||||||
return check("metaB()").about(fileMetas()).that(diffInfo.metaB);
|
return check("metaB").about(fileMetas()).that(diffInfo.metaB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -46,12 +46,12 @@ public class EditInfoSubject extends Subject<EditInfoSubject, EditInfo> {
|
|||||||
public CommitInfoSubject commit() {
|
public CommitInfoSubject commit() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
EditInfo editInfo = actual();
|
EditInfo editInfo = actual();
|
||||||
return check("commit()").about(commits()).that(editInfo.commit);
|
return check("commit").about(commits()).that(editInfo.commit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringSubject baseRevision() {
|
public StringSubject baseRevision() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
EditInfo editInfo = actual();
|
EditInfo editInfo = actual();
|
||||||
return check("baseRevision()").that(editInfo.baseRevision);
|
return check("baseRevision").that(editInfo.baseRevision);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -35,18 +35,18 @@ public class FileInfoSubject extends Subject<FileInfoSubject, FileInfo> {
|
|||||||
public IntegerSubject linesInserted() {
|
public IntegerSubject linesInserted() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
FileInfo fileInfo = actual();
|
FileInfo fileInfo = actual();
|
||||||
return check("linesInserted()").that(fileInfo.linesInserted);
|
return check("linesInserted").that(fileInfo.linesInserted);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntegerSubject linesDeleted() {
|
public IntegerSubject linesDeleted() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
FileInfo fileInfo = actual();
|
FileInfo fileInfo = actual();
|
||||||
return check("linesDeleted()").that(fileInfo.linesDeleted);
|
return check("linesDeleted").that(fileInfo.linesDeleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ComparableSubject<?, Character> status() {
|
public ComparableSubject<?, Character> status() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
FileInfo fileInfo = actual();
|
FileInfo fileInfo = actual();
|
||||||
return check("status()").that(fileInfo.status);
|
return check("status").that(fileInfo.status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -40,16 +40,16 @@ public class FixReplacementInfoSubject
|
|||||||
|
|
||||||
public StringSubject path() {
|
public StringSubject path() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
return check("path()").that(actual().path);
|
return check("path").that(actual().path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RangeSubject range() {
|
public RangeSubject range() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
return check("range()").about(ranges()).that(actual().range);
|
return check("range").about(ranges()).that(actual().range);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringSubject replacement() {
|
public StringSubject replacement() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
return check("replacement()").that(actual().replacement);
|
return check("replacement").that(actual().replacement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,6 @@
|
|||||||
package com.google.gerrit.extensions.common.testing;
|
package com.google.gerrit.extensions.common.testing;
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertAbout;
|
import static com.google.common.truth.Truth.assertAbout;
|
||||||
import static com.google.common.truth.Truth.assertWithMessage;
|
|
||||||
import static com.google.gerrit.extensions.common.testing.FixReplacementInfoSubject.fixReplacements;
|
import static com.google.gerrit.extensions.common.testing.FixReplacementInfoSubject.fixReplacements;
|
||||||
import static com.google.gerrit.truth.ListSubject.elements;
|
import static com.google.gerrit.truth.ListSubject.elements;
|
||||||
|
|
||||||
@@ -42,12 +41,12 @@ public class FixSuggestionInfoSubject extends Subject<FixSuggestionInfoSubject,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public StringSubject fixId() {
|
public StringSubject fixId() {
|
||||||
return assertWithMessage("fixId").that(actual().fixId);
|
return check("fixId").that(actual().fixId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ListSubject<FixReplacementInfoSubject, FixReplacementInfo> replacements() {
|
public ListSubject<FixReplacementInfoSubject, FixReplacementInfo> replacements() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
return check("replacements()")
|
return check("replacements")
|
||||||
.about(elements())
|
.about(elements())
|
||||||
.thatCustom(actual().replacements, fixReplacements());
|
.thatCustom(actual().replacements, fixReplacements());
|
||||||
}
|
}
|
||||||
@@ -58,6 +57,6 @@ public class FixSuggestionInfoSubject extends Subject<FixSuggestionInfoSubject,
|
|||||||
|
|
||||||
public StringSubject description() {
|
public StringSubject description() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
return check("description()").that(actual().description);
|
return check("description").that(actual().description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -44,25 +44,25 @@ public class GitPersonSubject extends Subject<GitPersonSubject, GitPerson> {
|
|||||||
public StringSubject name() {
|
public StringSubject name() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
GitPerson gitPerson = actual();
|
GitPerson gitPerson = actual();
|
||||||
return check("name()").that(gitPerson.name);
|
return check("name").that(gitPerson.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringSubject email() {
|
public StringSubject email() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
GitPerson gitPerson = actual();
|
GitPerson gitPerson = actual();
|
||||||
return check("email()").that(gitPerson.email);
|
return check("email").that(gitPerson.email);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ComparableSubject<?, Timestamp> date() {
|
public ComparableSubject<?, Timestamp> date() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
GitPerson gitPerson = actual();
|
GitPerson gitPerson = actual();
|
||||||
return check("date()").that(gitPerson.date);
|
return check("date").that(gitPerson.date);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntegerSubject tz() {
|
public IntegerSubject tz() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
GitPerson gitPerson = actual();
|
GitPerson gitPerson = actual();
|
||||||
return check("tz()").that(gitPerson.tz);
|
return check("tz").that(gitPerson.tz);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void hasSameDateAs(GitPerson other) {
|
public void hasSameDateAs(GitPerson other) {
|
||||||
|
@@ -37,19 +37,19 @@ public class RangeSubject extends Subject<RangeSubject, Comment.Range> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public IntegerSubject startLine() {
|
public IntegerSubject startLine() {
|
||||||
return check("startLine()").that(actual().startLine);
|
return check("startLine").that(actual().startLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntegerSubject startCharacter() {
|
public IntegerSubject startCharacter() {
|
||||||
return check("startCharacter()").that(actual().startCharacter);
|
return check("startCharacter").that(actual().startCharacter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntegerSubject endLine() {
|
public IntegerSubject endLine() {
|
||||||
return check("endLine()").that(actual().endLine);
|
return check("endLine").that(actual().endLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntegerSubject endCharacter() {
|
public IntegerSubject endCharacter() {
|
||||||
return check("endCharacter()").that(actual().endCharacter);
|
return check("endCharacter").that(actual().endCharacter);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void isValid() {
|
public void isValid() {
|
||||||
|
@@ -45,7 +45,7 @@ public class RobotCommentInfoSubject extends Subject<RobotCommentInfoSubject, Ro
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ListSubject<FixSuggestionInfoSubject, FixSuggestionInfo> fixSuggestions() {
|
public ListSubject<FixSuggestionInfoSubject, FixSuggestionInfo> fixSuggestions() {
|
||||||
return check("fixSuggestions()")
|
return check("fixSuggestions")
|
||||||
.about(elements())
|
.about(elements())
|
||||||
.thatCustom(actual().fixSuggestions, FixSuggestionInfoSubject.fixSuggestions());
|
.thatCustom(actual().fixSuggestions, FixSuggestionInfoSubject.fixSuggestions());
|
||||||
}
|
}
|
||||||
|
@@ -68,7 +68,7 @@ public class CommitSubject extends Subject<CommitSubject, RevCommit> {
|
|||||||
public void hasCommitMessage(String expectedCommitMessage) {
|
public void hasCommitMessage(String expectedCommitMessage) {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
RevCommit commit = actual();
|
RevCommit commit = actual();
|
||||||
check("commitMessage()").that(commit.getFullMessage()).isEqualTo(expectedCommitMessage);
|
check("getFullMessage()").that(commit.getFullMessage()).isEqualTo(expectedCommitMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -36,6 +36,6 @@ public class ObjectIdSubject extends Subject<ObjectIdSubject, ObjectId> {
|
|||||||
public void hasName(String expectedName) {
|
public void hasName(String expectedName) {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
ObjectId objectId = actual();
|
ObjectId objectId = actual();
|
||||||
check("name()").that(objectId.getName()).isEqualTo(expectedName);
|
check("getName()").that(objectId.getName()).isEqualTo(expectedName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -49,14 +49,14 @@ public class PushResultSubject extends Subject<PushResultSubject, PushResult> {
|
|||||||
public void hasMessages(String... expectedLines) {
|
public void hasMessages(String... expectedLines) {
|
||||||
checkArgument(expectedLines.length > 0, "use hasNoMessages()");
|
checkArgument(expectedLines.length > 0, "use hasNoMessages()");
|
||||||
isNotNull();
|
isNotNull();
|
||||||
check("messages()").that(trimMessages()).isEqualTo(String.join("\n", expectedLines));
|
check("trimmedMessages()").that(trimMessages()).isEqualTo(String.join("\n", expectedLines));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void containsMessages(String... expectedLines) {
|
public void containsMessages(String... expectedLines) {
|
||||||
checkArgument(expectedLines.length > 0, "use hasNoMessages()");
|
checkArgument(expectedLines.length > 0, "use hasNoMessages()");
|
||||||
isNotNull();
|
isNotNull();
|
||||||
Iterable<String> got = Splitter.on("\n").split(trimMessages());
|
Iterable<String> got = Splitter.on("\n").split(trimMessages());
|
||||||
check("messages()").that(got).containsAtLeastElementsIn(expectedLines).inOrder();
|
check("trimmedMessages()").that(got).containsAtLeastElementsIn(expectedLines).inOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String trimMessages() {
|
private String trimMessages() {
|
||||||
|
@@ -91,7 +91,7 @@ public class SerializedClassSubject extends Subject<SerializedClassSubject, Clas
|
|||||||
public void hasAutoValueMethods(Map<String, Type> expectedMethods) {
|
public void hasAutoValueMethods(Map<String, Type> expectedMethods) {
|
||||||
// Would be nice if we could check clazz is an @AutoValue, but the retention is not RUNTIME.
|
// Would be nice if we could check clazz is an @AutoValue, but the retention is not RUNTIME.
|
||||||
isAbstract();
|
isAbstract();
|
||||||
check("noArgumentAbstractMethodsOn(%s)", actual().getName())
|
check("noArgumentAbstractMethods()")
|
||||||
.that(
|
.that(
|
||||||
Arrays.stream(actual().getDeclaredMethods())
|
Arrays.stream(actual().getDeclaredMethods())
|
||||||
.filter(m -> !Modifier.isStatic(m.getModifiers()))
|
.filter(m -> !Modifier.isStatic(m.getModifiers()))
|
||||||
@@ -103,8 +103,6 @@ public class SerializedClassSubject extends Subject<SerializedClassSubject, Clas
|
|||||||
|
|
||||||
public void extendsClass(Type superclassType) {
|
public void extendsClass(Type superclassType) {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
check("superclass(%s)", actual().getName())
|
check("getGenericSuperclass()").that(actual().getGenericSuperclass()).isEqualTo(superclassType);
|
||||||
.that(actual().getGenericSuperclass())
|
|
||||||
.isEqualTo(superclassType);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,66 +45,66 @@ public class InternalGroupSubject extends Subject<InternalGroupSubject, Internal
|
|||||||
public ComparableSubject<?, AccountGroup.UUID> groupUuid() {
|
public ComparableSubject<?, AccountGroup.UUID> groupUuid() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
InternalGroup group = actual();
|
InternalGroup group = actual();
|
||||||
return check("groupUuid()").that(group.getGroupUUID());
|
return check("getGroupUUID()").that(group.getGroupUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ComparableSubject<?, AccountGroup.NameKey> nameKey() {
|
public ComparableSubject<?, AccountGroup.NameKey> nameKey() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
InternalGroup group = actual();
|
InternalGroup group = actual();
|
||||||
return check("nameKey()").that(group.getNameKey());
|
return check("getNameKey()").that(group.getNameKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringSubject name() {
|
public StringSubject name() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
InternalGroup group = actual();
|
InternalGroup group = actual();
|
||||||
return check("name()").that(group.getName());
|
return check("getName()").that(group.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Subject<DefaultSubject, Object> id() {
|
public Subject<DefaultSubject, Object> id() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
InternalGroup group = actual();
|
InternalGroup group = actual();
|
||||||
return check("id()").that(group.getId());
|
return check("getId()").that(group.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringSubject description() {
|
public StringSubject description() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
InternalGroup group = actual();
|
InternalGroup group = actual();
|
||||||
return check("description()").that(group.getDescription());
|
return check("getDescription()").that(group.getDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ComparableSubject<?, AccountGroup.UUID> ownerGroupUuid() {
|
public ComparableSubject<?, AccountGroup.UUID> ownerGroupUuid() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
InternalGroup group = actual();
|
InternalGroup group = actual();
|
||||||
return check("ownerGroupUuid()").that(group.getOwnerGroupUUID());
|
return check("getOwnerGroupUUID()").that(group.getOwnerGroupUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
public BooleanSubject visibleToAll() {
|
public BooleanSubject visibleToAll() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
InternalGroup group = actual();
|
InternalGroup group = actual();
|
||||||
return check("visibleToAll()").that(group.isVisibleToAll());
|
return check("isVisibleToAll()").that(group.isVisibleToAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ComparableSubject<?, Timestamp> createdOn() {
|
public ComparableSubject<?, Timestamp> createdOn() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
InternalGroup group = actual();
|
InternalGroup group = actual();
|
||||||
return check("createdOn()").that(group.getCreatedOn());
|
return check("getCreatedOn()").that(group.getCreatedOn());
|
||||||
}
|
}
|
||||||
|
|
||||||
public IterableSubject members() {
|
public IterableSubject members() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
InternalGroup group = actual();
|
InternalGroup group = actual();
|
||||||
return check("members()").that(group.getMembers());
|
return check("getMembers()").that(group.getMembers());
|
||||||
}
|
}
|
||||||
|
|
||||||
public IterableSubject subgroups() {
|
public IterableSubject subgroups() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
InternalGroup group = actual();
|
InternalGroup group = actual();
|
||||||
return check("subgroups()").that(group.getSubgroups());
|
return check("getSubgroups()").that(group.getSubgroups());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ComparableSubject<?, ObjectId> refState() {
|
public ComparableSubject<?, ObjectId> refState() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
InternalGroup group = actual();
|
InternalGroup group = actual();
|
||||||
return check("refState()").that(group.getRefState());
|
return check("getRefState()").that(group.getRefState());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,16 +45,16 @@ public class ChangeFileContentModificationSubject
|
|||||||
|
|
||||||
public StringSubject filePath() {
|
public StringSubject filePath() {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
return check("filePath()").that(actual().getFilePath());
|
return check("getFilePath()").that(actual().getFilePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
public StringSubject newContent() throws IOException {
|
public StringSubject newContent() throws IOException {
|
||||||
isNotNull();
|
isNotNull();
|
||||||
RawInput newContent = actual().getNewContent();
|
RawInput newContent = actual().getNewContent();
|
||||||
check("newContent()").that(newContent).isNotNull();
|
check("getNewContent()").that(newContent).isNotNull();
|
||||||
String contentString =
|
String contentString =
|
||||||
CharStreams.toString(
|
CharStreams.toString(
|
||||||
new InputStreamReader(newContent.getInputStream(), StandardCharsets.UTF_8));
|
new InputStreamReader(newContent.getInputStream(), StandardCharsets.UTF_8));
|
||||||
return check("newContent()").that(contentString);
|
return check("getNewContent()").that(contentString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user