From 6a04b5e037617e1e26bf4c148e5800633ecd2a32 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 2 May 2024 13:27:11 +0400 Subject: [PATCH] #247 -- Add test class --- build.gradle | 1 + .../java/ru/ulstu/StreamApiUtilsTest.java | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/test/java/ru/ulstu/StreamApiUtilsTest.java diff --git a/build.gradle b/build.gradle index 1e7e723..9657951 100644 --- a/build.gradle +++ b/build.gradle @@ -112,4 +112,5 @@ dependencies { implementation group: 'xalan', name: 'xalan', version: '2.7.2' testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test' + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.10.2' } diff --git a/src/test/java/ru/ulstu/StreamApiUtilsTest.java b/src/test/java/ru/ulstu/StreamApiUtilsTest.java new file mode 100644 index 0000000..5782cbb --- /dev/null +++ b/src/test/java/ru/ulstu/StreamApiUtilsTest.java @@ -0,0 +1,19 @@ +package ru.ulstu; + + +import org.junit.jupiter.api.Test; +import ru.ulstu.core.util.StreamApiUtils; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class StreamApiUtilsTest { + @Test + public void testMappingByDay() { + List integersInitial = List.of(1, 2); + List integers = StreamApiUtils.convert(List.of("1", "2"), Integer::valueOf); + + assertEquals(integersInitial, integers); + } +}