use of org.ff4j.aop.FeatureAdvisor in project ff4j by ff4j.
the class InvalidParameter method testInvalidParameter.
@Test(expected = IllegalArgumentException.class)
public void testInvalidParameter() throws Throwable {
final IDoIt service = new IDoItImpl();
service.doIt("");
FeatureAdvisor fa = new FeatureAdvisor();
fa.setFf4j(new FF4j("test-ff4j-features.xml"));
MethodInvocation mi = new MethodInvocation() {
public Object proceed() throws Throwable {
return null;
}
public Object getThis() {
return service;
}
public AccessibleObject getStaticPart() {
return null;
}
public Object[] getArguments() {
return null;
}
public Method getMethod() {
try {
Method m = IDoIt.class.getMethod("doIt", String.class);
return m;
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
return null;
}
};
fa.invoke(mi);
}
Aggregations