@@ -112,7 +112,7 @@ public void testDatasetLabelsSingle() {
112112 @ org .junit .jupiter .api .Test
113113 public void testDatasetLabelSingleWithReduceFunctionArray () {
114114 withExampleSchemas ((schemas ) -> {
115- int labelReduce = addLabel (schemas [0 ], "sum" , "value => { return value.reduce((a,b) => a+b); }" ,
115+ int labelReduce = addLabel (schemas [0 ], "sum" , "value => { return value[0] .reduce((a,b) => a+b); }" ,
116116 new Extractor ("value" , "$.samplesArray" , true ));
117117 List <Label .Value > values = withLabelValues (createSampleArray ());
118118 assertEquals (30 , values .stream ().filter (v -> v .labelId == labelReduce ).map (v -> v .value .numberValue ()).findFirst ()
@@ -123,7 +123,7 @@ public void testDatasetLabelSingleWithReduceFunctionArray() {
123123 @ org .junit .jupiter .api .Test
124124 public void testDatasetLabelAsyncSingleWithReduceFunctionArray () {
125125 withExampleSchemas ((schemas ) -> {
126- int labelReduce = addLabel (schemas [0 ], "sum" , "async (value) => { return value.reduce((a,b) => a+b); }" ,
126+ int labelReduce = addLabel (schemas [0 ], "sum" , "async (value) => { return value[0] .reduce((a,b) => a+b); }" ,
127127 new Extractor ("value" , "$.samplesArray" , true ));
128128 List <Label .Value > values = withLabelValues (createSampleArray ());
129129 assertEquals (30 , values .stream ().filter (v -> v .labelId == labelReduce ).map (v -> v .value .numberValue ()).findFirst ()
@@ -568,7 +568,12 @@ public void labelValuesWithAllMatchMultipleExtractorsAndJs() {
568568 addLabelResponse .then ().statusCode (201 );
569569
570570 List <Integer > ids = uploadRun (
571- "{ \" bar\" : \" test1\" , \" foo\" : [{\" inner\" :[{\" id\" : 1}, {\" id\" : 2}]}, {\" inner\" :[{\" id\" : 3}]}, {\" inner\" :[{\" id\" : 4}, {\" id\" : 5}]}]}" ,
571+ """
572+ {
573+ "bar": "test1",
574+ "foo": [{"inner":[{"id": 1}, {"id": 2}]}, {"inner":[{"id": 3}]}, {"inner":[{"id": 4}, {"id": 5}]}]
575+ }
576+ """ ,
572577 t .name , fooSchema .uri );
573578 assertEquals (1 , ids .size ());
574579 // force to recalculate datasets and label values sync
@@ -586,7 +591,6 @@ public void labelValuesWithAllMatchMultipleExtractorsAndJs() {
586591 .as (JsonNode .class );
587592
588593 // expecting an array of arrays [[1, 2], [3], [4, 5]]
589- Log .info (preview .toString ());
590594 JsonNode previewValue = preview .get ("value" );
591595 assertInstanceOf (ArrayNode .class , previewValue );
592596 assertEquals (3 , previewValue .size ());
@@ -607,7 +611,6 @@ public void labelValuesWithAllMatchMultipleExtractorsAndJs() {
607611 assertInstanceOf (ObjectNode .class , arrayResponse .get (0 ));
608612 ObjectNode objectNode = (ObjectNode ) arrayResponse .get (0 );
609613
610- Log .info (objectNode .toString ());
611614 assertEquals ("labelFoo" , objectNode .get ("name" ).asText ());
612615 assertTrue (objectNode .get ("value" ).isArray ());
613616 // expecting an array of arrays [[1, 2], [3], [4, 5]]
@@ -635,7 +638,12 @@ public void labelValuesWithAllMatchSingleExtractorAndJs() {
635638 addLabelResponse .then ().statusCode (201 );
636639
637640 List <Integer > ids = uploadRun (
638- "{ \" bar\" : \" test1\" , \" foo\" : [{\" inner\" :[{\" id\" : 1}, {\" id\" : 2}]}, {\" inner\" :[{\" id\" : 3}]}, {\" inner\" :[{\" id\" : 4}, {\" id\" : 5}]}]}" ,
641+ """
642+ {
643+ "bar": "test1",
644+ "foo": [{"inner":[{"id": 1}, {"id": 2}]}, {"inner":[{"id": 3}]}, {"inner":[{"id": 4}, {"id": 5}]}]
645+ }
646+ """ ,
639647 t .name , fooSchema .uri );
640648 assertEquals (1 , ids .size ());
641649 // force to recalculate datasets and label values sync
@@ -653,7 +661,6 @@ public void labelValuesWithAllMatchSingleExtractorAndJs() {
653661 .as (JsonNode .class );
654662
655663 // expecting an array of arrays [[1, 2], [3], [4, 5]]
656- Log .info (preview .toString ());
657664 JsonNode previewValue = preview .get ("value" );
658665 assertInstanceOf (ArrayNode .class , previewValue );
659666 assertEquals (3 , previewValue .size ());
@@ -674,7 +681,6 @@ public void labelValuesWithAllMatchSingleExtractorAndJs() {
674681 assertInstanceOf (ObjectNode .class , arrayResponse .get (0 ));
675682 ObjectNode objectNode = (ObjectNode ) arrayResponse .get (0 );
676683
677- Log .info (objectNode .toString ());
678684 assertEquals ("labelFoo" , objectNode .get ("name" ).asText ());
679685 assertTrue (objectNode .get ("value" ).isArray ());
680686 // expecting an array of arrays [[1, 2], [3], [4, 5]]
@@ -702,7 +708,12 @@ public void labelValuesWithFirstMatchSingleExtractorAndJs() {
702708 addLabelResponse .then ().statusCode (201 );
703709
704710 List <Integer > ids = uploadRun (
705- "{ \" bar\" : \" test1\" , \" foo\" : [{\" inner\" :[{\" id\" : 1}, {\" id\" : 2}]}, {\" inner\" :[{\" id\" : 3}]}, {\" inner\" :[{\" id\" : 4}, {\" id\" : 5}]}]}" ,
711+ """
712+ {
713+ "bar": "test1",
714+ "foo": [{"inner":[{"id": 1}, {"id": 2}]}, {"inner":[{"id": 3}]}, {"inner":[{"id": 4}, {"id": 5}]}]
715+ }
716+ """ ,
706717 t .name , fooSchema .uri );
707718 assertEquals (1 , ids .size ());
708719 // force to recalculate datasets and label values sync
@@ -720,7 +731,6 @@ public void labelValuesWithFirstMatchSingleExtractorAndJs() {
720731 .as (JsonNode .class );
721732
722733 // expecting an array of arrays [1, 2]
723- Log .info (preview .toString ());
724734 JsonNode previewValue = preview .get ("value" );
725735 assertInstanceOf (ArrayNode .class , previewValue );
726736 assertEquals (2 , previewValue .size ());
@@ -741,7 +751,6 @@ public void labelValuesWithFirstMatchSingleExtractorAndJs() {
741751 assertInstanceOf (ObjectNode .class , arrayResponse .get (0 ));
742752 ObjectNode objectNode = (ObjectNode ) arrayResponse .get (0 );
743753
744- Log .info (objectNode .toString ());
745754 assertEquals ("labelFoo" , objectNode .get ("name" ).asText ());
746755 assertTrue (objectNode .get ("value" ).isArray ());
747756 // expecting an array of arrays [1, 2]
0 commit comments