Skip to content
Snippets Groups Projects
Commit 9c7e116c authored by Zhibin Mai's avatar Zhibin Mai
Browse files

Enhance the verification on whether two datasets are the same

parent 92a30b7e
No related branches found
No related tags found
1 merge request!846Refactor the augmenter to search and fetch indexed data from the ElasticSearch service directly
Pipeline #294904 failed
Pipeline: Indexer

#294905

    ......@@ -222,7 +222,7 @@ public class PropertyUtil {
    if(rightMap == null) {
    rightMap = new HashMap<>();
    }
    // If leftMap does not have property A and rightMap has a property A but with null value
    // If leftMap does not have property A and rightMap has a property A with null value
    // Maps.difference will consider that leftMap and rightMap are different.
    // In our case, they are the same. Using Gson serialization/deserialization to remove
    // the properties with null value on both sides
    ......@@ -248,7 +248,7 @@ public class PropertyUtil {
    Object left = valueDifference.leftValue();
    Object right = valueDifference.rightValue();
    if(left == null && right == null) {
    continue;
    //Same
    }
    else if(left == null || right == null) {
    changedProperties.add(entry.getKey());
    ......
    ......@@ -29,7 +29,6 @@ import java.util.List;
    import java.util.Map;
    import lombok.SneakyThrows;
    import org.junit.Assert;
    import org.junit.Ignore;
    import org.junit.Test;
    import org.junit.runner.RunWith;
    import org.springframework.test.context.junit4.SpringRunner;
    ......@@ -50,7 +49,6 @@ public class PropertyUtilTest {
    }
    @Test
    @Ignore
    public void getValueOfNoneNestedProperty() {
    Map<String, Object> data = this.getDataMap("wellLog.json");
    ......@@ -76,9 +74,9 @@ public class PropertyUtilTest {
    Assert.assertTrue(value.containsKey(propertyName));
    Assert.assertNotNull(value.get(propertyName));
    }
    // The null value is ignored
    for(String propertyName : propertyNamesWithNullValues) {
    Assert.assertTrue(value.containsKey(propertyName));
    Assert.assertNull(value.get(propertyName));
    Assert.assertFalse(value.containsKey(propertyName));
    }
    value = PropertyUtil.getValueOfNoneNestedProperty("Curves[].CurveID", data);
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment