diff options
author | Josh Haberman <jhaberman@gmail.com> | 2018-09-04 10:58:54 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2018-09-04 10:58:54 -0700 |
commit | d61aede89cf188367766b971f59cf57d7835d8e8 (patch) | |
tree | a19842c62c3c8f51389912ecafdf932d0a572bea /java/core/src/test/java/com/google/protobuf/AnyTest.java | |
parent | 45d03a977193d1dcce5251e4bffe17bf0ba738ec (diff) | |
download | protobuf-d61aede89cf188367766b971f59cf57d7835d8e8.tar.gz protobuf-d61aede89cf188367766b971f59cf57d7835d8e8.tar.bz2 protobuf-d61aede89cf188367766b971f59cf57d7835d8e8.zip |
Down-integrate from google3.
Diffstat (limited to 'java/core/src/test/java/com/google/protobuf/AnyTest.java')
-rw-r--r-- | java/core/src/test/java/com/google/protobuf/AnyTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/java/core/src/test/java/com/google/protobuf/AnyTest.java b/java/core/src/test/java/com/google/protobuf/AnyTest.java index cf91ed91..2fe04a94 100644 --- a/java/core/src/test/java/com/google/protobuf/AnyTest.java +++ b/java/core/src/test/java/com/google/protobuf/AnyTest.java @@ -32,7 +32,7 @@ package com.google.protobuf; import any_test.AnyTestProto.TestAny; import protobuf_unittest.UnittestProto.TestAllTypes; - +import java.util.Objects; import junit.framework.TestCase; /** @@ -56,7 +56,7 @@ public class AnyTest extends TestCase { // Unpacking to a wrong type will throw an exception. try { - TestAny wrongMessage = container.getValue().unpack(TestAny.class); + container.getValue().unpack(TestAny.class); fail("Exception is expected."); } catch (InvalidProtocolBufferException e) { // expected. @@ -68,7 +68,7 @@ public class AnyTest extends TestCase { ByteString.copyFrom(new byte[]{0x11})); container = containerBuilder.build(); try { - TestAllTypes parsingFailed = container.getValue().unpack(TestAllTypes.class); + container.getValue().unpack(TestAllTypes.class); fail("Exception is expected."); } catch (InvalidProtocolBufferException e) { // expected. @@ -132,6 +132,6 @@ public class AnyTest extends TestCase { TestAllTypes result1 = container.getValue().unpack(TestAllTypes.class); TestAllTypes result2 = container.getValue().unpack(TestAllTypes.class); - assertTrue(result1 == result2); + assertTrue(Objects.equals(result1, result2)); } } |