AbstractSimpleMatcher implements Matcher { @Override public final boolean matches(Parameter parameter, Object value, Object... properties) { if (properties.length != 1) { throw new InvalidArgumentException( "Expected exactly one parameter to be passed down: " + parameter.getPath()); } return matches(parameter, value, properties[0]); }  @Override final boolean matches(Parameter parameter, Object value, Object... properties); @Override boolean isApplicableTo(Class<?> parameterType, Class<?>... propertiesTypes);  }
@Test(expectedExceptions = InvalidArgumentException.class, expectedExceptionsMessageRegExp = ".*x.y.z.*") public void testWhenHasNoParameters() { final NotMatchingSimpleMatcher matcher = new NotMatchingSimpleMatcher(); matcher.matches(new ImmutableParameter("x.y.z", null, null, null), new Object()); }
@Test(expectedExceptions = InvalidArgumentException.class, expectedExceptionsMessageRegExp = ".*x.y.z.*") public void testWhenHasMoreThanOneParameters() { final NotMatchingSimpleMatcher matcher = new NotMatchingSimpleMatcher(); matcher.matches(new ImmutableParameter("x.y.z", null, null, null), new Object(), 1, 2, 3); }
@Test public void testWhenHasOneParameter() { final NotMatchingSimpleMatcher matcher = new NotMatchingSimpleMatcher(); matcher.matches(new ImmutableParameter("x.y.z", null, null, null), new Object(), 1); }