@CheckReturnValue public class LiteProtoSubject extends Subject
LiteProtoSubject supports versions 2 and 3 of Protocol Buffers. Due to the lack of runtime descriptors, its functionality is limited compared to ProtoSubject, in particular in performing detailed comparisons between messages.
Subject.Factory<SubjectT extends Subject,ActualT>| Modifier | Constructor and Description |
|---|---|
protected |
LiteProtoSubject(FailureMetadata failureMetadata,
MessageLite messageLite) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
actualCustomStringRepresentation() |
void |
hasAllRequiredFields()
Checks whether the subject has all required fields set.
|
void |
isEqualTo(MessageLite.Builder builder)
Deprecated.
A Builder can never compare equal to a MessageLite instance. Use
build(),
or buildPartial() on the argument to get a MessageLite for comparison instead. |
void |
isEqualTo(Object expected)
Checks whether the MessageLite is equivalent to the argument, using the standard equals()
implementation.
|
void |
isEqualToDefaultInstance()
Checks whether the subject is a
MessageLite with no fields set. |
void |
isNotEqualTo(MessageLite.Builder builder)
Deprecated.
A Builder will never compare equal to a MessageLite instance. Use
build(),
or buildPartial() on the argument to get a MessageLite for comparison instead. |
void |
isNotEqualTo(Object expected) |
void |
isNotEqualToDefaultInstance()
Checks whether the subject is not equivalent to a
MessageLite with no fields set. |
IntegerSubject |
serializedSize()
Returns an
IntegerSubject on the serialized size of the MessageLite. |
check, equals, failWithActual, failWithActual, failWithoutActual, hashCode, ignoreCheck, isAnyOf, isIn, isInstanceOf, isNoneOf, isNotIn, isNotInstanceOf, isNotNull, isNotSameInstanceAs, isNull, isSameInstanceAs, toStringprotected LiteProtoSubject(FailureMetadata failureMetadata, @NullableDecl MessageLite messageLite)
protected String actualCustomStringRepresentation()
actualCustomStringRepresentation in class Subjectpublic void isEqualTo(@NullableDecl
Object expected)
@Deprecated public void isEqualTo(@NullableDecl MessageLite.Builder builder)
build(),
or buildPartial() on the argument to get a MessageLite for comparison instead.public void isNotEqualTo(@NullableDecl
Object expected)
isNotEqualTo in class Subject@Deprecated public void isNotEqualTo(@NullableDecl MessageLite.Builder builder)
build(),
or buildPartial() on the argument to get a MessageLite for comparison instead.public void isEqualToDefaultInstance()
MessageLite with no fields set.public void isNotEqualToDefaultInstance()
MessageLite with no fields set.public void hasAllRequiredFields()
build(), which itself fails if required fields aren't set.public IntegerSubject serializedSize()
IntegerSubject on the serialized size of the MessageLite.
Assertions can then be changed on the serialized size, to support checks such as assertThat(myProto).serializedSize().isAtLeast(16), etc.
Copyright © 2020. All rights reserved.