Class ProtoTruth
- java.lang.Object
-
- com.google.common.truth.extensions.proto.ProtoTruth
-
public final class ProtoTruth extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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.static CustomSubjectBuilder.Factory<ProtoSubjectBuilder>protos()Returns aCustomSubjectBuilder.Factory, akin to aSubject.Factory, which can be used to assert on multiple types of Protos and collections containing them.
-
-
-
Method Detail
-
protos
public static CustomSubjectBuilder.Factory<ProtoSubjectBuilder> protos()
Returns aCustomSubjectBuilder.Factory, akin to aSubject.Factory, which can be used to assert on multiple types of Protos and collections containing them.
-
assertThat
public static LiteProtoSubject assertThat(@Nullable MessageLite messageLite)
Assert on a singleMessageLiteinstance.
-
assertThat
public static ProtoSubject assertThat(@Nullable Message message)
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
public static <M extends Message> MapWithProtoValuesSubject<M> assertThat(@Nullable Map<?,M> map)
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.
-
-