Closed ILadis closed 4 months ago
This pull request adds support for JUnit 5 parameterized tests. With the proposed changes it is now possible to use @JUnitPerfTest on a @ParameterizedTest method.
@JUnitPerfTest
@ParameterizedTest
Here's an example of how this can be used:
@ExtendWith(JUnitPerfInterceptor.class) public class ExampleParameterizedTests { @ValueSource(strings = { "www.google.com", "www.example.com" }) @ParameterizedTest(name = "test1(hostname = {0})") @JUnitPerfTest(durationMs = 3_000, maxExecutionsPerSecond = 1) public void test1(String hostname) throws IOException { try (Socket socket = new Socket()) { socket.connect(new InetSocketAddress(hostname, 80), 1000); } } }
I'm open for any feedback.
This pull request adds support for JUnit 5 parameterized tests.
With the proposed changes it is now possible to use
@JUnitPerfTest
on a@ParameterizedTest
method.Here's an example of how this can be used:
I'm open for any feedback.