diff --git a/test/aud/exam/prep/DoubleListProvider.java b/test/aud/exam/prep/DoubleListProvider.java new file mode 100644 index 0000000..99a2511 --- /dev/null +++ b/test/aud/exam/prep/DoubleListProvider.java @@ -0,0 +1,19 @@ +package aud.exam.prep; + +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.ArgumentsProvider; + +import java.util.stream.Stream; + +public class DoubleListProvider implements ArgumentsProvider { + + @Override + public Stream provideArguments(ExtensionContext extensionContext) { + return Stream + .generate(() -> + Arguments.of(Tests.randomList(), Tests.randomList())) + .limit(Tests.STEAM_SIZE); + } + +} diff --git a/test/aud/exam/prep/ListProvider.java b/test/aud/exam/prep/ListProvider.java index caafa3f..4bbe79f 100644 --- a/test/aud/exam/prep/ListProvider.java +++ b/test/aud/exam/prep/ListProvider.java @@ -4,8 +4,6 @@ import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.ArgumentsProvider; -import java.util.List; -import java.util.stream.Collectors; import java.util.stream.Stream; public class ListProvider implements ArgumentsProvider { @@ -13,16 +11,9 @@ public class ListProvider implements ArgumentsProvider { @Override public Stream provideArguments(ExtensionContext extensionContext) { return Stream - .generate(this::randomList) + .generate(Tests::randomList) .map(Arguments::of) .limit(Tests.STEAM_SIZE); } - private List randomList() { - var size = Tests.RANDOM.nextInt(50); - return Tests.RANDOM - .ints(size, 0, 100) - .boxed() - .collect(Collectors.toList()); - } } diff --git a/test/aud/exam/prep/Tests.java b/test/aud/exam/prep/Tests.java index 360f829..08472b3 100644 --- a/test/aud/exam/prep/Tests.java +++ b/test/aud/exam/prep/Tests.java @@ -1,10 +1,20 @@ package aud.exam.prep; +import java.util.List; import java.util.Random; +import java.util.stream.Collectors; public class Tests { public static final int STEAM_SIZE = 50; public static final Random RANDOM = new Random(); + + static List randomList() { + var size = RANDOM.nextInt(50); + return RANDOM + .ints(size, 0, 100) + .boxed() + .collect(Collectors.toList()); + } }