DefaultDataProviderMethodResolver implements DataProviderMethodResolver { @Override public List<Method> resolve(DataProviderResolverContext context) { checkNotNull(context, "'context' must not be null"); List<Method> dataProviderMethods = findAnnotatedMethods(context.getLocations(), context.getDataProviderAnnotationClass()); List<Method> result = new ArrayList<Method>(); for (Method dataProviderMethod : dataProviderMethods) { if (context.useDataProviderNameConvention()) { if (isMatchingNameConvention(context.getTestMethod().getName(), dataProviderMethod.getName())) { result.add(dataProviderMethod); } } else if (dataProviderMethod.getName().equals(context.getDataProviderName())) { result.add(dataProviderMethod); } } return result; }  @Override List<Method> resolve(DataProviderResolverContext context);  }
@Test public void testResolveShouldThrowNullPointerExceptionIfContextIsNull() { expectedException.expect(NullPointerException.class); expectedException.expectMessage("'context' must not be null"); underTest.resolve(null); }