|
20 | 20 | import java.util.Map;
|
21 | 21 | import java.util.function.BiFunction;
|
22 | 22 |
|
23 |
| -import org.apache.commons.lang3.tuple.Pair; |
24 | 23 | import org.bson.Document;
|
25 | 24 | import org.bson.json.JsonWriterSettings;
|
26 | 25 | import org.bson.types.Binary;
|
@@ -102,7 +101,7 @@ public static void verifyDocumentWithAlias(Document document, String expectedAli
|
102 | 101 | Pair<Object, Object> values = handler.apply(expectedValue, document);
|
103 | 102 |
|
104 | 103 | JsonWriterSettings jsonWriterSettings = JsonWriterSettings.builder().indent(true).build();
|
105 |
| - assertEquals(values.getLeft(), values.getRight(), |
| 104 | + assertEquals(values.left, values.right, |
106 | 105 | "Document: (" + expectedValue.getClass().getSimpleName() + ") " + document.toJson(jsonWriterSettings));
|
107 | 106 |
|
108 | 107 | assertNotNull(document.get("_id"));
|
@@ -203,4 +202,10 @@ private static Pair<Object, Object> handleRawType(Object ev, Document doc) {
|
203 | 202 | Object value = doc.get(MongoDBFields.FIELD_VALUE);
|
204 | 203 | return Pair.of(expectedDoc, value != null ? value : new Object());
|
205 | 204 | }
|
| 205 | + |
| 206 | + public record Pair<L, R> (L left, R right) { |
| 207 | + public static <L, R> Pair<L, R> of(final L left, final R right) { |
| 208 | + return left != null || right != null ? new Pair<>(left, right) : new Pair<>(null, null); |
| 209 | + } |
| 210 | + } |
206 | 211 | }
|
0 commit comments