This is an automated email from the ASF dual-hosted git repository.

yhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new cf3592bbfa0 Fix an incompatibility with hamcrest 2.2 (#31395)
cf3592bbfa0 is described below

commit cf3592bbfa079dfbaf4fd1aebfd05aaf2a2e86e9
Author: Liam Miller-Cushon <cus...@google.com>
AuthorDate: Fri May 24 18:58:51 2024 -0700

    Fix an incompatibility with hamcrest 2.2 (#31395)
    
    This test asserts on the message of an AssertionError thrown by a
    failing hamcrest assertion. The message changes in the latest versions
    of hamcrest.
    
    ```
    1) 
testBadCoderIsNotDeterministic(org.apache.beam.sdk.testing.CoderPropertiesTest)
    java.lang.AssertionError:
    Expected: a string containing "<84>, <101>, <115>, <116>, <68>"
         but: was "
    Expected: [<24b>, <84b>, <101b>, <115b>, <116b>, <68b>, <97b>, <116b>, 
<97b>, <51b>, <51b>, <50b>, <54b>, <49b>, <57b>, <57b>, <52b>, <57b>, <48b>, 
<57b>, <57b>, <55b>, <48b>, <53b>, <53b>]
         but: was [<24b>, <84b>, <101b>, <115b>, <116b>, <68b>, <97b>, <116b>, 
<97b>, <51b>, <51b>, <50b>, <54b>, <49b>, <57b>, <57b>, <52b>, <56b>, <50b>, 
<48b>, <52b>, <49b>, <54b>, <49b>, <53b>]"
            at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
            at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
            at 
org.apache.beam.sdk.testing.CoderPropertiesTest.testBadCoderIsNotDeterministic(CoderPropertiesTest.java:123)
    ```
---
 .../test/java/org/apache/beam/sdk/testing/CoderPropertiesTest.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/CoderPropertiesTest.java
 
b/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/CoderPropertiesTest.java
index 3530f20e722..7c4a9d04614 100644
--- 
a/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/CoderPropertiesTest.java
+++ 
b/sdks/java/core/src/test/java/org/apache/beam/sdk/testing/CoderPropertiesTest.java
@@ -120,7 +120,11 @@ public class CoderPropertiesTest {
       error = e;
     }
     assertNotNull("Expected AssertionError", error);
-    assertThat(error.getMessage(), CoreMatchers.containsString("<84>, <101>, 
<115>, <116>, <68>"));
+    assertThat(
+        error.getMessage(),
+        CoreMatchers.anyOf(
+            CoreMatchers.containsString("<84>, <101>, <115>, <116>, <68>"),
+            CoreMatchers.containsString("<84b>, <101b>, <115b>, <116b>, 
<68b>")));
   }
 
   @Test

Reply via email to