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

mibo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/olingo-odata2.git


The following commit(s) were added to refs/heads/master by this push:
     new bb025a9  [OLINGO-1561] Fix flakiness in `JPAEntityTest`
bb025a9 is described below

commit bb025a9fba6b948d4e7b74f9d8d8253a05d8c98a
Author: Alexander Ronald Altman <[email protected]>
AuthorDate: Sat Dec 4 14:18:11 2021 -0800

    [OLINGO-1561] Fix flakiness in `JPAEntityTest`
    
    `testCreateODataEntryPropertyWithOutCallBack` was failing under 
[NonDex](https://github.com/TestingResearchIllinois/NonDex) because of 
implementation-defined ordering of some internals; this PR fixes this 
accidental reliance on nondeterministic behavior.
---
 .../odata2/jpa/processor/core/access/data/JPAEntityTest.java       | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityTest.java
 
b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityTest.java
index f54ceab..0e1e943 100644
--- 
a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityTest.java
+++ 
b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityTest.java
@@ -18,10 +18,13 @@
  
******************************************************************************/
 package org.apache.olingo.odata2.jpa.processor.core.access.data;
 
+import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.junit.matchers.JUnitMatchers.either;
 
 import java.net.URISyntaxException;
 
@@ -196,7 +199,9 @@ public class JPAEntityTest {
       jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, 
mockODataJPAContextWithoutCallBack());
       
jpaEntity.create(ODataEntryMockUtil.mockODataEntryProperties(JPATypeMock.ENTITY_NAME));
     } catch (ODataJPARuntimeException e) {
-      assertEquals(ODataJPARuntimeException.ERROR_JPA_BLOB_NULL.getKey(), 
e.getMessageReference().getKey());
+      assertThat(e.getMessageReference().getKey(), either(
+          is(ODataJPARuntimeException.ERROR_JPA_BLOB_NULL.getKey())).or(
+          is(ODataJPARuntimeException.ERROR_JPA_CLOB_NULL.getKey())));
       return;
     } catch (EdmException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()

Reply via email to