Skip to content

Commit adb8ebc

Browse files
committed
Add and adjust integration test for lookup
Related to: metafix/src/test/java/org/metafacture/metafix/MetafixLookupTest.java
1 parent dd514f7 commit adb8ebc

File tree

7 files changed

+59
-2
lines changed

7 files changed

+59
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"animals" : [ "mammal", "bird", "fish" ]
3+
}
4+
{
5+
"animals" : [ "bird", "fish" ]
6+
}
7+
{
8+
"animals" : [ "mammal" ]
9+
}
10+
{
11+
"animals" : [ "mammal", "fish" ]
12+
}
13+
{
14+
"animals" : [ ]
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"animals" : [ "dog", "parrot", "shark" ]
3+
}
4+
{
5+
"animals" : [ "human", "parrot", "shark" ]
6+
}
7+
{
8+
"animals" : [ "dog" ]
9+
}
10+
{
11+
"animals" : [ "dog", "human", "shark" ]
12+
}
13+
{
14+
"animals" : [ "human" ]
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dog mammal
2+
cat mammal
3+
parrot bird
4+
shark fish
5+
dragon fictional animal
6+
unicorn fictional animal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lookup("animals[].*", "./mapfile.tsv", "sep_char":"\t", delete:"true")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FLUX_DIR + "input.json"
2+
|open-file
3+
|as-records
4+
|decode-json
5+
|fix(FLUX_DIR + "test.fix")
6+
|encode-json(prettyPrinting="true")
7+
|write(FLUX_DIR + "output-metafix.json")
8+
;

metafix/src/test/resources/org/metafacture/metafix/integration/lookup/fromJson/toJson/lookupInArrayOfStringsWithNotMatchingValues/expected.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
"animals" : [ "mammal", "bird", "fish" ]
33
}
44
{
5-
"animals" : [ "human" ]
5+
"animals" : [ "human", "bird", "fish" ]
66
}
77
{
88
"animals" : [ "mammal" ]
99
}
10+
{
11+
"animals" : [ "mammal", "human", "fish" ]
12+
}
13+
{
14+
"animals" : [ "human" ]
15+
}

metafix/src/test/resources/org/metafacture/metafix/integration/lookup/fromJson/toJson/lookupInArrayOfStringsWithNotMatchingValues/input.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
"animals" : [ "dog", "parrot", "shark" ]
33
}
44
{
5-
"animals" : [ "human" ]
5+
"animals" : [ "human", "parrot", "shark" ]
66
}
77
{
88
"animals" : [ "dog" ]
99
}
10+
{
11+
"animals" : [ "dog", "human", "shark" ]
12+
}
13+
{
14+
"animals" : [ "human" ]
15+
}

0 commit comments

Comments
 (0)