S
- Subject class type.M
- MessageLite type.@CheckReturnValue @ParametersAreNonnullByDefault public class LiteProtoSubject<S extends LiteProtoSubject<S,M>,M extends com.google.protobuf.MessageLite> extends Subject<S,M>
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.
Modifier and Type | Class and Description |
---|---|
static class |
LiteProtoSubject.Factory<S extends LiteProtoSubject<S,M>,M extends com.google.protobuf.MessageLite>
Typed extension of
SubjectFactory . |
failureStrategy
Modifier | Constructor and Description |
---|---|
protected |
LiteProtoSubject(FailureStrategy failureStrategy,
M messageLite) |
Modifier and Type | Method and Description |
---|---|
protected String |
getTrimmedDisplaySubject() |
void |
hasAllRequiredFields()
Checks whether the subject has all required fields set.
|
void |
isEqualTo(com.google.protobuf.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(com.google.protobuf.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)
Fails if the subject is equal to the given object.
|
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. |
actual, actualAsString, actualCustomStringRepresentation, check, equals, fail, fail, fail, failComparing, failComparing, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutSubject, failWithRawMessage, failWithRawMessageAndCause, getDisplaySubject, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isIn, isInstanceOf, isNoneOf, isNotIn, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, named
protected LiteProtoSubject(FailureStrategy failureStrategy, @Nullable M messageLite)
protected String getTrimmedDisplaySubject()
public void isEqualTo(@Nullable Object expected)
@Deprecated public void isEqualTo(@Nullable com.google.protobuf.MessageLite.Builder builder)
build()
,
or buildPartial()
on the argument to get a MessageLite for comparison instead.public void isNotEqualTo(@Nullable Object expected)
Subject
Subject.isEqualTo(java.lang.Object)
method.isNotEqualTo
in class Subject<S extends LiteProtoSubject<S,M>,M extends com.google.protobuf.MessageLite>
@Deprecated public void isNotEqualTo(@Nullable com.google.protobuf.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 © 2017. All rights reserved.