Class ProtoTruth
java.lang.Object
com.google.common.truth.extensions.proto.ProtoTruth
A set of static methods to begin a Truth assertion chain for protocol buffers.
Note: Usage of different failure strategies such as assume and expect should
rely on StandardSubjectBuilder.about(CustomSubjectBuilder.Factory)
to begin a chain with
those alternative behaviors.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <M extends Message>
MultimapWithProtoValuesSubject<M> assertThat
(@Nullable Multimap<?, M> multimap) static ProtoSubject
assertThat
(@Nullable Message message) Assert on a singleMessage
instance.static LiteProtoSubject
assertThat
(@Nullable MessageLite messageLite) Assert on a singleMessageLite
instance.static <M extends Message>
IterableOfProtosSubject<M> assertThat
(@Nullable Iterable<M> messages) Assert on a sequence ofMessage
s.static <M extends Message>
MapWithProtoValuesSubject<M> assertThat
(@Nullable Map<?, M> map) Assert on a map withMessage
values.protos()
Returns aCustomSubjectBuilder.Factory
, akin to aSubject.Factory
, which can be used to assert on multiple types of Protos and collections containing them.
-
Method Details
-
protos
Returns aCustomSubjectBuilder.Factory
, akin to aSubject.Factory
, which can be used to assert on multiple types of Protos and collections containing them. -
assertThat
Assert on a singleMessageLite
instance. -
assertThat
Assert on a singleMessage
instance. -
assertThat
public static <M extends Message> IterableOfProtosSubject<M> assertThat(@Nullable Iterable<M> messages) Assert on a sequence ofMessage
s.This allows for the equality configurations on
ProtoSubject
to be applied to all comparison tests available onIterableSubject.UsingCorrespondence
. -
assertThat
Assert on a map withMessage
values.This allows for the equality configurations on
ProtoSubject
to be applied to all comparison tests available onMapSubject.UsingCorrespondence
. -
assertThat
public static <M extends Message> MultimapWithProtoValuesSubject<M> assertThat(@Nullable Multimap<?, M> multimap) Assert on aMultimap
withMessage
values.This allows for the equality configurations on
ProtoSubject
to be applied to all comparison tests available onMultimapSubject.UsingCorrespondence
.
-