barbara
barbara

Reputation: 3201

How to choose specific data supplier in JUnit?

I have two data suppliers and bunch of tests.

@Parameters(name = "good")
public static Collection goodNumbers() {...}

@Parameters(name = "bad")
public static Collection badNumbers() {...}

How can I choose a good data for one group of tests and a bad data for another group?

Upvotes: 0

Views: 239

Answers (1)

Stefan Birkner
Stefan Birkner

Reputation: 24510

It looks like you're using JUnit's @Parameterized runner. This runner doesn't support multiple data suppliers. You need a separate test class for each group of tests. The name is only used for naming the data set. Please have a look at the Parameterized documentation.

Upvotes: 1

Related Questions