MessageDifferencer

34 views
Skip to first unread message

Sweety SW

unread,
Jun 19, 2019, 7:20:20 AM6/19/19
to Protocol Buffers
Is there any example available for using MessageDifferencer in java with any extension ?

I see classes exist in Truth-Proto extension, but how to use those classes is what I am not able to figure out 

Screenshot from 2019-06-19 16-52-13.png

Hao Nguyen

unread,
Jun 25, 2019, 9:57:47 AM6/25/19
to Protocol Buffers
You can take a look at the Truth proto test: https://github.com/google/truth/blob/master/extensions/proto/src/test/java/com/google/common/truth/extensions/proto/ProtoSubjectTest.java

Basically you would need to call something like:
com.google.common.truth.extensions.proto.ProtoTruth.assertThat(message).isEqualTo(expected);

Sweety SW

unread,
Jun 26, 2019, 12:30:28 AM6/26/19
to Protocol Buffers
I tried to use  "com.google.common.truth.extensions.proto.ProtoTruth.assertThat(message).isEqualTo(expected);"

And was getting exception, "Class "X" incompatible with com.google.protobuf.MessageLite".

Is there anything I can do here ?
Reply all
Reply to author
Forward
0 new messages