- java.lang.Object
-
- net.morimekta.proto.testing.ProtoMatchers
-
public class ProtoMatchers extends Object
Matchers for proto buffers.
-
-
Constructor Summary
Constructors Constructor Description ProtoMatchers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <M extends com.google.protobuf.Message>
org.hamcrest.Matcher<M>equalToMessage(M expected, String... ignoring)Expect a message, with optional fields to be ignored.static <M extends com.google.protobuf.Message>
org.hamcrest.Matcher<M>equalToMessageIgnoreExtensions(M expected, String... ignoring)Expect a message, with optional fields to be ignored.
-
-
-
Method Detail
-
equalToMessage
public static <M extends com.google.protobuf.Message> org.hamcrest.Matcher<M> equalToMessage(M expected, String... ignoring)Expect a message, with optional fields to be ignored. Ignored fields will both be ignored in comparison and in diff output.- Type Parameters:
M- Message type.- Parameters:
expected- Expected message.ignoring- Ignored fields. This is a set of field paths following the same path spec as inFieldMask.- Returns:
- The matcher.
-
equalToMessageIgnoreExtensions
public static <M extends com.google.protobuf.Message> org.hamcrest.Matcher<M> equalToMessageIgnoreExtensions(M expected, String... ignoring)Expect a message, with optional fields to be ignored. Ignored fields will both be ignored in comparison and in diff output. Also ignoring all extensions.- Type Parameters:
M- Message type.- Parameters:
expected- Expected message.ignoring- Ignored fields. This can be any field descriptor, including extensions.- Returns:
- The matcher.
-
-