/** * Matches an array of parameters to an array of instances. * * @return matches or not * @see #exactMatch(Class[], Object[]) */ public static boolean exactMatch(final Parameter[] parameters, final Object[] args) { return exactMatch(classesFromParameters(parameters), args); }
/** * Matches an array of parameters to an array of instances. * * @return matches or not * @see #exactMatch(Class[], Object[]) */ public static boolean exactMatch(final Parameter[] parameters, final Object[] args) { return exactMatch(classesFromParameters(parameters), args); }
/** * {@inheritDoc} */ @Override protected boolean match(final Parameter[] parameters, final Object[] arguments) { return ReflectionRecipes.exactMatch(parameters, getContext().getArguments()); }
/** {@inheritDoc} */ @Override protected boolean match(final Parameter[] parameters, final Object[] arguments) { return ReflectionRecipes.exactMatch(parameters, getContext().getArguments()); }
@Test(dataProvider = "exactMatchDP") public void exactMatchTest(final Object[][] expected, @NoInjection final Method method) { if (expected != null) { final Parameter[] methodParameters = ReflectionRecipes.getMethodParameters(method); Assert.assertNotNull(methodParameters); final Parameter[] filteredParameters = ReflectionRecipes.filter(methodParameters, InjectableParameter.Assistant.ALL_INJECTS); Assert.assertNotNull(filteredParameters); for (final Object[] expect : expected) { Assert.assertNotNull(expect); Assert.assertEquals(expect.length, 2); Assert.assertNotNull(expect[0]); Assert.assertTrue(expect[0] instanceof Object[]); Assert.assertNotNull(expect[1]); Assert.assertTrue(expect[1] instanceof Boolean); Assert.assertEquals( ReflectionRecipes.exactMatch(filteredParameters, (Object[]) expect[0]), expect[1] ); } } }