Skip to content

Commit 961dbab

Browse files
committed
[NOID] fix tests
1 parent 1362c8f commit 961dbab

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

full/src/main/java/apoc/export/arrow/ImportArrow.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,27 @@ public Stream<ProgressInfo> importFile(
113113
},
114114
HashMap::putAll);
115115

116-
String relType = (String) row.remove(FIELD_TYPE);
116+
String relType = (String) row.remove(FIELD_TYPE.getName());
117117
if (relType == null) {
118118
// is node
119-
String[] stringLabels = (String[]) row.remove(FIELD_LABELS);
119+
String[] stringLabels = (String[]) row.remove(FIELD_LABELS.getName());
120120
Label[] labels = Optional.ofNullable(stringLabels)
121121
.map(l -> Arrays.stream(l).map(Label::label).toArray(Label[]::new))
122122
.orElse(new Label[] {});
123123
final Node node = btx.getTransaction().createNode(labels);
124124

125-
long id = (long) row.remove(FIELD_ID);
125+
long id = (long) row.remove(FIELD_ID.getName());
126126
idMapping.put(id, node.getId());
127127

128128
addProps(row, node);
129129
reporter.update(1, 0, row.size());
130130
} else {
131131
// is relationship
132-
long sourceId = (long) row.remove(FIELD_SOURCE_ID);
132+
long sourceId = (long) row.remove(FIELD_SOURCE_ID.getName());
133133
Long idSource = idMapping.get(sourceId);
134134
final Node source = btx.getTransaction().getNodeById(idSource);
135135

136-
long targetId = (long) row.remove(FIELD_TARGET_ID);
136+
long targetId = (long) row.remove(FIELD_TARGET_ID.getName());
137137
Long idTarget = idMapping.get(targetId);
138138
final Node target = btx.getTransaction().getNodeById(idTarget);
139139

@@ -269,7 +269,6 @@ public static Object toValidValue(Object object, String field, Map<String, Objec
269269
*/
270270
private static Object convertValue(String value, String typeName) {
271271
switch (typeName) {
272-
// {"crs":"wgs-84-3d","latitude":13.1,"longitude":33.46789,"height":100.0}
273272
case "Point":
274273
return getPointValue(value);
275274
case "LocalDateTime":
@@ -323,7 +322,7 @@ private static Object convertValue(String value, String typeName) {
323322
private static PointValue getPointValue(String value) {
324323
try {
325324
return PointValue.parse(value);
326-
} catch (Neo4jException e) {
325+
} catch (RuntimeException e) {
327326
// fallback in case of double-quotes, e.g.
328327
// {"crs":"wgs-84-3d","latitude":13.1,"longitude":33.46789,"height":100.0}
329328
// we remove the double quotes before parsing the result, e.g.

full/src/test/java/apoc/export/arrow/ImportArrowTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ public class ImportArrowTest {
3939
directory.mkdirs();
4040
}
4141

42-
private final Map<String, Object> MAPPING_ALL = Map.of(
43-
"mapping",
44-
Map.of("bffSince", "Duration", "place", "Point", "listInt", "LongArray", "born", "LocalDateTime"));
42+
private final Map<String, Object> MAPPING_ALL =
43+
Map.of("mapping", Map.of("bffSince", "Duration", "place", "Point", "listInt", "LongArray", "born", "LocalDateTime"));
4544

4645
@ClassRule
4746
public static DbmsRule db = new ImpermanentDbmsRule()

0 commit comments

Comments
 (0)