Back to Intellij Community

MalformedDataProvider

plugins/testng/resources/inspectionDescriptions/MalformedDataProvider.html

2025.3-rc-2481 B
Original Source

Reports references to data provider methods that do not exist or are not accessible.

Example:

public class InstanceDataProviderFromForeignClass {
  // method data() doesn't exist in class A
  @Test(dataProvider = "data", dataProviderClass = A.class)
  public void test() {
  }
}
class A { }

After the quick-fix is applied:

//the needed data() method is created in class A
class A {
  @DataProvider
  public Object[][] data() {
    return new Object[][]{};
  }
}