Skip to content

Commit

Permalink
Use scala.jdk.javaapi.CollectionConverters in JavaHigherOrderFunction…
Browse files Browse the repository at this point in the history
…sSuite
  • Loading branch information
rednaxelafx committed Jan 2, 2024
1 parent bc7e949 commit daf06fd
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.List;
import static java.util.stream.Collectors.toList;

import scala.jdk.CollectionConverters;
import scala.jdk.javaapi.CollectionConverters;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
Expand Down Expand Up @@ -222,10 +222,10 @@ public void testTransformKeys() throws Exception {
checkAnswer(
mapDf.select(transform_keys(col("x"), (k, v) -> k.plus(v))),
toRows(
CollectionConverters.MapHasAsScala(new HashMap<Integer, Integer>() {{
CollectionConverters.asScala(new HashMap<Integer, Integer>() {{
put(2, 1);
put(4, 2);
}}).asScala(),
}}),
null
)
);
Expand All @@ -236,10 +236,10 @@ public void testTransformValues() throws Exception {
checkAnswer(
mapDf.select(transform_values(col("x"), (k, v) -> k.plus(v))),
toRows(
CollectionConverters.MapHasAsScala(new HashMap<Integer, Integer>() {{
CollectionConverters.asScala(new HashMap<Integer, Integer>() {{
put(1, 2);
put(2, 4);
}}).asScala(),
}}),
null
)
);
Expand All @@ -250,7 +250,7 @@ public void testMapFilter() throws Exception {
checkAnswer(
mapDf.select(map_filter(col("x"), (k, v) -> lit(false))),
toRows(
CollectionConverters.MapHasAsScala(new HashMap<Integer, Integer>()).asScala(),
CollectionConverters.asScala(new HashMap<Integer, Integer>()),
null
)
);
Expand All @@ -261,10 +261,10 @@ public void testMapZipWith() throws Exception {
checkAnswer(
mapDf.select(map_zip_with(col("x"), col("x"), (k, v1, v2) -> lit(false))),
toRows(
CollectionConverters.MapHasAsScala(new HashMap<Integer, Boolean>() {{
CollectionConverters.asScala(new HashMap<Integer, Boolean>() {{
put(1, false);
put(2, false);
}}).asScala(),
}}),
null
)
);
Expand Down

0 comments on commit daf06fd

Please sign in to comment.