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 ProtoSubjectassertThat(@Nullable Message message) Assert on a singleMessageinstance.static LiteProtoSubjectassertThat(@Nullable MessageLite messageLite) Assert on a singleMessageLiteinstance.static <M extends Message>
IterableOfProtosSubject<M> assertThat(@Nullable Iterable<M> messages) Assert on a sequence ofMessages.static <M extends Message>
MapWithProtoValuesSubject<M> assertThat(@Nullable Map<?, M> map) Assert on a map withMessagevalues.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 singleMessageLiteinstance. -
assertThat
Assert on a singleMessageinstance. -
assertThat
public static <M extends Message> IterableOfProtosSubject<M> assertThat(@Nullable Iterable<M> messages) Assert on a sequence ofMessages.This allows for the equality configurations on
ProtoSubjectto be applied to all comparison tests available onIterableSubject.UsingCorrespondence. -
assertThat
Assert on a map withMessagevalues.This allows for the equality configurations on
ProtoSubjectto be applied to all comparison tests available onMapSubject.UsingCorrespondence. -
assertThat
public static <M extends Message> MultimapWithProtoValuesSubject<M> assertThat(@Nullable Multimap<?, M> multimap) Assert on aMultimapwithMessagevalues.This allows for the equality configurations on
ProtoSubjectto be applied to all comparison tests available onMultimapSubject.UsingCorrespondence.
-