title: How Data Provider of TestNG sends data to Test internally?
body: <p><strong>My question is :</strong> </p>
  
  <p>How "Data Provider" sends the data to the Test internally ? </p>
  
  <p>What actually happens behind the scenes, so that we get the sent data in the "Test"?. </p>
  
  <p>I am very curious to know that, how data provider and test get connected to each other just by mentioning name of the "data provider", and "data Provider" sends data to Test.</p>
  
  <p>Does "Data Provider" calls the test and passes the data as parameters ? </p>
  
  <pre><code>testMethod("data one", "Data two");
  </code></pre>
  
  <p><strong>My Data Provider code :</strong>  </p>
  
  <pre><code>   import org.testng.annotations.DataProvider;
  
      public class DataProviderClass {
  
      @DataProvider(name = "data-provider")
          public static Object[][] dataProviderMethod() {
          return new Object[][] { { "data one" }, { "data two" } };
      }
  }
  </code></pre>
  
  <p><strong>My Test code :</strong></p>
  
  <pre><code>@Test(dataProvider = "data-provider")
  public void testMethod(String dataOne, String dataTwo) {
      System.out.println("Data is: " + dataOne + " " + dataTwo);
  }
  </code></pre>