Questions tagged [parameterized-tests]

55 questions
1
vote
1 answer

How to pass multiple parallel streams to Junit5 Parameterized test?

I have two ArrayList<> Objects of equal lengths, and my Junit5 parameterized test has the syntax: @ParamterizedTest @MethodSource("dummyfunction"); void functionName(String s1, String s2) { ..... ..... } private Stream
Dhrubojit
  • 93
  • 1
  • 1
  • 5
1
vote
1 answer

how to change csvparsersettings of junit parameterized tests using @csvsource

Given a simple test-method, annotated as @ParameterizedTest, employing input via Annotation @CsvSource (e.g.@CsvSource({ "@", "*", "#", "?", "-", "$", "!", "0" }). When running said test, the test interrupts as soon as "#" is supposed to be tested.…
Navid Noor
  • 13
  • 3
1
vote
1 answer

Parameterizing tests with pytest

I am learning about parameterized tests with pyest. After following the relevant pytest documentation, I came up with this simple example: import unittest import pytest @pytest.fixture(autouse=True, params=['foo', 'bar']) def foo(request): …
Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
1
vote
0 answers

maven-failsafe-plugin: Groups are getting ignored when setUp parameterized Test

I have configured the maven-failsafe-plugin for excluding/including some testcategories: org.apache.maven.plugins maven-failsafe-plugin
Rokko_11
  • 837
  • 2
  • 10
  • 24
1
vote
1 answer

NUnit TestCaseAttribute causing AmbiguousMatchException with NUnit VS Adapter

I wrote a bunch of unit tests that utilized the TestCaseAttribute. These tests run great on my local machine when I use the ReSharper unit test runner. Unfortunately, when I run the tests through Visual Studio with the NUnit VS Adapter 2.0.0.0 I get…
1
vote
1 answer

Pass a list of string values to a parameterized JUnit test

I am trying to pass a collection of string values from a properties file to a parameterized JUnit test. Properties.values() returns Collection while JUnit requires the parameters be passed in Collection structure. Does that mean I have to convert…
techjourneyman
  • 1,701
  • 3
  • 33
  • 53
1
vote
1 answer

JUnit parameterized test with varying parameters

Consider a parameterized JUnit test. JUnit provides a way to parameterize such a test using a static method: @Parameterized.Parameters public static Collection parameters(){ Object[][] data = new Object[][] { { 1, 11 }, { 2, 22…
gexicide
  • 38,535
  • 21
  • 92
  • 152
1
vote
1 answer

JUnit / TestNG execute @BeforeXXX method before all tests having the same parameter

I have the following problem: I have a parameterized test it has a list of parameters it has several test methods test methods need a set up for each parameter More detailed: for each file in list [...] parse file to several tables in db -…
igogorek
  • 56
  • 4
0
votes
2 answers

How can we edit parameter of multiple Jenkins job simultaneously?

I have multiple parameterized Jenkins jobs to run multiple tests. I need to update one parameter of all the Jenkins jobs. Instead of changing the parameters one by one, is there a way to edit all the jobs simultaneously? I tried to edit manually,…
0
votes
0 answers

How to feed @ParameterizedTest based on config value

So I have created a parameterized test, which is a simple restassured test which logs into a user account. I have some spring bean config in place, which you can specify a profile to pick up a certain test env, QA1, QA2, QA3 for example. In each…
Chi
  • 1
  • 1
0
votes
0 answers

ParameterResolutionException when using multiple test method parameter

I have the following test case: @ParameterizedTest @JsonFileSource(resources = {"/poc/person.json", "/poc/person2.json"}) void test_jsonfilesource_2(@ConvertWith(DataConverter.class) Person person, …
HowToTellAChild
  • 623
  • 1
  • 9
  • 21
0
votes
1 answer

JUnit 5 Parameterized test @ArgumentsSource parameters not loading

I have created below JUnit5 parameterized test with ArgumentsSource for loading arguments for the test: public class DemoModelValidationTest { public ParamsProvider paramsProvider; public DemoModelValidationTest () { try { …
0
votes
1 answer

JUnit 5, IntelliJ, Maven

i am currently working on a Project with Tests in JUnit 4 and i should migrate them to JUnit 5. Now i have the Problem that i have a Parameterized test in JUnit 4. Lets say my test looks like this: @RunWith(Parameterized.class) public class…
javaTopics
  • 11
  • 3
0
votes
1 answer

Why are JUnit5 Parametrized tests using argument providers not defined in @ArgumentSource?

I have a problem with my parameterized tests. @ParameterizedTest @ArgumentsSource(CorrectMessagesArgumentProvider.class) void shouldSendMessageForCorrectConfiguration(SmtpConfiguration configuration) { var expectedMessageBody =…
bkomo
  • 65
  • 1
  • 9
0
votes
1 answer

How to use multiple pytest fixtures with same parameterized input to test methods in a class

I want to achieve something like this: my conftest.py will contain: fixture_1 - will do some manipulation with input such as a, b, c using request.param fixture_2 - will do some manipulation with input such as a, b, c using request.param fixture_3…