use of com.axway.ats.core.reflect.MethodFinder in project ats-framework by Axway.
the class Test_StringToEnumRule method isCompatibleNegativeWrongArgType.
@Test(expected = NoSuchMethodException.class)
public void isCompatibleNegativeWrongArgType() throws NoSuchMethodException, AmbiguousMethodException {
List<TypeComparisonRule> typeComparisonRules = new ArrayList<TypeComparisonRule>();
typeComparisonRules.add(new StringToEnumRule());
MethodFinder methodFinder = new MethodFinder("methods", Arrays.asList(ActionClassEnumArguments.class.getDeclaredMethods()), typeComparisonRules);
//String argument
assertNotNull(methodFinder.findMethod(new Class<?>[] { Integer.class }));
}
use of com.axway.ats.core.reflect.MethodFinder in project ats-framework by Axway.
the class Test_StringToEnumRule method isCompatiblePositive.
@Test
public void isCompatiblePositive() throws NoSuchMethodException, AmbiguousMethodException {
List<TypeComparisonRule> typeComparisonRules = new ArrayList<TypeComparisonRule>();
typeComparisonRules.add(new StringToEnumRule());
MethodFinder methodFinder = new MethodFinder("methods", Arrays.asList(ActionClassEnumArguments.class.getDeclaredMethods()), typeComparisonRules);
//String argument
assertNotNull(methodFinder.findMethod(new Class<?>[] { String.class }));
//array of Strings argument
assertNotNull(methodFinder.findMethod(new Class<?>[] { (new String[] {}).getClass(), Integer.TYPE }));
}
Aggregations