SimpleFunctionResolver extends BaseFunctionResolver { public SimpleFunctionResolver withClass(Class<? extends StellarFunction> clazz) { this.classesToResolve.add(clazz); return this; }  @Override Set<Class<? extends StellarFunction>> resolvables(); SimpleFunctionResolver withClass(Class<? extends StellarFunction> clazz);  }
@Test public void testFunctionResolution() { resolver.withClass(IAmAFunction.class); List<String> functions = Lists.newArrayList(resolver.getFunctions()); assertEquals(1, functions.size()); assertTrue(functions.contains("namespace_function")); }
@Test public void testApply() { resolver.withClass(IAmAFunction.class); final String functionName = "namespace_function"; StellarFunction fn = resolver.apply(functionName); assertTrue(fn instanceof IAmAFunction); }
@Test public void testFunctionResolutionWithMissingAnnotation() { resolver.withClass(MissingAnnotation.class); List<String> functions = Lists.newArrayList(resolver.getFunctions()); assertEquals(0, functions.size()); }
@Test public void testIgnoreDuplicates() { resolver.withClass(IAmAFunction.class); resolver.withClass(IAmAFunction.class); List<String> functions = Lists.newArrayList(resolver.getFunctions()); assertEquals(1, functions.size()); }