|
15 | 15 | import io.weaviate.ConcurrentTest; |
16 | 16 | import io.weaviate.client6.v1.api.WeaviateClient; |
17 | 17 | import io.weaviate.client6.v1.api.collections.CollectionConfig; |
| 18 | +import io.weaviate.client6.v1.api.collections.GeoCoordinates; |
| 19 | +import io.weaviate.client6.v1.api.collections.PhoneNumber; |
18 | 20 | import io.weaviate.client6.v1.api.collections.WeaviateObject; |
19 | 21 | import io.weaviate.client6.v1.api.collections.annotations.Collection; |
20 | 22 | import io.weaviate.client6.v1.api.collections.annotations.Property; |
@@ -79,7 +81,10 @@ static record Thing( |
79 | 81 | Boolean booleanBoxed, |
80 | 82 | boolean[] booleanArray, |
81 | 83 | Boolean[] booleanBoxedArray, |
82 | | - List<Boolean> booleanBoxedList) { |
| 84 | + List<Boolean> booleanBoxedList, |
| 85 | + |
| 86 | + PhoneNumber phoneNumber, |
| 87 | + GeoCoordinates geoCoordinates) { |
83 | 88 | } |
84 | 89 |
|
85 | 90 | @BeforeClass |
@@ -150,14 +155,18 @@ public void test_createCollection() throws Exception { |
150 | 155 | Map.entry("booleanBoxed", "boolean"), |
151 | 156 | Map.entry("booleanArray", "boolean[]"), |
152 | 157 | Map.entry("booleanBoxedArray", "boolean[]"), |
153 | | - Map.entry("booleanBoxedList", "boolean[]")); |
| 158 | + Map.entry("booleanBoxedList", "boolean[]"), |
| 159 | + |
| 160 | + Map.entry("phoneNumber", "phoneNumber"), |
| 161 | + Map.entry("geoCoordinates", "geoCoordinates")); |
154 | 162 | } |
155 | 163 |
|
156 | | - private final RecursiveComparisonConfiguration COMPARISON_CONFIG = RecursiveComparisonConfiguration.builder() |
| 164 | + private static final RecursiveComparisonConfiguration COMPARISON_CONFIG = RecursiveComparisonConfiguration.builder() |
157 | 165 | // Assertj is having a really bad time comparing List<Float>, |
158 | 166 | // so we'll just always return true here. |
159 | 167 | .withComparatorForFields((a, b) -> 0, "floatBoxedList") |
160 | 168 | .withComparatorForType((a, b) -> Double.compare(a.doubleValue(), b.doubleValue()), Number.class) |
| 169 | + .withComparatorForType(ORMITest::comparePhoneNumbers, PhoneNumber.class) |
161 | 170 | .build(); |
162 | 171 |
|
163 | 172 | @Test |
@@ -219,7 +228,10 @@ public void test_insertAndQuery() throws Exception { |
219 | 228 | boolean_, |
220 | 229 | new boolean[] { boolean_ }, |
221 | 230 | new Boolean[] { boolean_ }, |
222 | | - List.of(boolean_)); |
| 231 | + List.of(boolean_), |
| 232 | + |
| 233 | + PhoneNumber.international("+380 95 1433336"), |
| 234 | + new GeoCoordinates(1f, 2f)); |
223 | 235 |
|
224 | 236 | var things = client.collections.use(Thing.class); |
225 | 237 |
|
@@ -294,7 +306,10 @@ public void test_insertManyAndQuery() throws Exception { |
294 | 306 | boolean_, |
295 | 307 | new boolean[] { boolean_ }, |
296 | 308 | new Boolean[] { boolean_ }, |
297 | | - List.of(boolean_)); |
| 309 | + List.of(boolean_), |
| 310 | + |
| 311 | + PhoneNumber.international("+380 95 1433336"), |
| 312 | + new GeoCoordinates(1f, 2f)); |
298 | 313 |
|
299 | 314 | var things = client.collections.use(Thing.class); |
300 | 315 |
|
@@ -351,7 +366,7 @@ public void test_partialScan() throws IOException { |
351 | 366 | .returns(null, Song::monthlyListeners); |
352 | 367 | } |
353 | 368 |
|
354 | | - @Test |
355 | | - public void test_nestedProperties() throws IOException { |
| 369 | + static int comparePhoneNumbers(PhoneNumber phone1, PhoneNumber phone2) { |
| 370 | + return phone1.rawInput().compareTo(phone2.rawInput()); |
356 | 371 | } |
357 | 372 | } |
0 commit comments