diff --git a/pom.xml b/pom.xml index 8aa7e41..96eddb2 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 1.6 3.0.0-M7 2.14.1 - 6.1.6 + 7.0.0 2.7.0 1.18.24 5.9.2 diff --git a/src/main/java/com/aerospike/documentapi/util/Utils.java b/src/main/java/com/aerospike/documentapi/util/Utils.java index c049d3c..4a8da03 100644 --- a/src/main/java/com/aerospike/documentapi/util/Utils.java +++ b/src/main/java/com/aerospike/documentapi/util/Utils.java @@ -1,8 +1,8 @@ package com.aerospike.documentapi.util; import com.aerospike.client.Bin; +import com.aerospike.client.Value; import com.aerospike.client.cdt.CTX; -import com.aerospike.client.cdt.MapOrder; import com.aerospike.documentapi.jsonpath.JsonPathObject; import com.aerospike.documentapi.jsonpath.JsonPathParser; import com.aerospike.documentapi.jsonpath.PathDetails; @@ -11,7 +11,6 @@ import lombok.experimental.UtilityClass; import java.util.List; -import java.util.Map; @UtilityClass public class Utils { @@ -25,11 +24,7 @@ public static Bin createBinByJsonNodeType(String binName, JsonNode jsonNode) { } public static Bin createBin(String binName, Object jsonObject) { - if (jsonObject instanceof Map) { - return new Bin(binName, (Map) jsonObject, MapOrder.KEY_ORDERED); - } else { - return new Bin(binName, jsonObject); - } + return new Bin(binName, Value.get(jsonObject)); } public static void validateNotArray(Object object) throws IllegalArgumentException { diff --git a/src/test/java/com/aerospike/documentapi/DocumentAPIBatchTests.java b/src/test/java/com/aerospike/documentapi/DocumentAPIBatchTests.java index be36ae3..a7e7447 100644 --- a/src/test/java/com/aerospike/documentapi/DocumentAPIBatchTests.java +++ b/src/test/java/com/aerospike/documentapi/DocumentAPIBatchTests.java @@ -325,9 +325,12 @@ void testNegativeBatchPut() { assertTrue(results.stream().anyMatch(res -> res.resultCode != ResultCode.OK)); // making sure all records contain the resulting record == null and the necessary resulting code - // OP_NOT_APPLICABLE = 26, PARAMETER_ERROR = 4 - batchOpsList.forEach(batchOp -> assertTrue(batchOp.getBatchRecord().record == null - && (batchOp.getBatchRecord().resultCode == 26 || batchOp.getBatchRecord().resultCode == 4))); + // OP_NOT_APPLICABLE = 26, PARAMETER_ERROR = 4, BIN_TYPE_ERROR = 12 + batchOpsList.forEach(batchOp -> { + BatchRecord batchRecord = batchOp.getBatchRecord(); + assertTrue(batchRecord.record == null + && (batchRecord.resultCode == 26 || batchRecord.resultCode == 4 || batchRecord.resultCode == 12)); + }); } /**