@Test(expected = IllegalArgumentException.class)
  public void testGetDataProviderMethodShouldThrowIllegalArgumentExceptionIfTestMethodIsNull() {
    // Given:

    // When:
    underTest.getDataProviderMethod(null);

    // Then: expect exception
  }
  @Test
  public void testGetDataProviderMethodShouldReturnNullForNonDataProviderMethod() {
    // Given:
    doReturn(null).when(testMethod).getAnnotation(UseDataProvider.class);

    // When:
    FrameworkMethod result = underTest.getDataProviderMethod(testMethod);

    // Then:
    assertThat(result).isNull();
  }
  @Test
  public void testGetDataProviderMethodShouldReturnNullForNotFoundDataProviderMethod() {
    // Given:
    doReturn(useDataProvider).when(testMethod).getAnnotation(UseDataProvider.class);
    doReturn("notAvailableDataProviderMethod").when(useDataProvider).value();

    doReturn(testClass).when(underTest).findDataProviderLocation(useDataProvider);
    doReturn(asList(dataProviderMethod)).when(testClass).getAnnotatedMethods(DataProvider.class);
    doReturn("availableDataProviderMethod").when(dataProviderMethod).getName();

    // When:
    FrameworkMethod result = underTest.getDataProviderMethod(testMethod);

    // Then:
    assertThat(result).isNull();
  }
  @Test
  public void testGetDataProviderMethodShouldReturnDataProviderMethodIfItExists() {
    // Given:
    final String dataProviderMethodName = "availableDataProviderMethod";

    doReturn(useDataProvider).when(testMethod).getAnnotation(UseDataProvider.class);
    doReturn(dataProviderMethodName).when(useDataProvider).value();

    doReturn(testClass).when(underTest).findDataProviderLocation(useDataProvider);

    doReturn(asList(dataProviderMethod)).when(testClass).getAnnotatedMethods(DataProvider.class);
    doReturn(dataProviderMethodName).when(dataProviderMethod).getName();

    // When:
    FrameworkMethod result = underTest.getDataProviderMethod(testMethod);

    // Then:
    assertThat(result).isEqualTo(dataProviderMethod);
  }