WebServiceInterfaceValidator { public void validate() { if (!serviceInterface.isInterface()) throw new Error("service interface must be interface, serviceInterface=" + serviceInterface.getCanonicalName()); validator.beanClassNameValidator.validate(serviceInterface); Map<String, Method> methodNames = Maps.newHashMap(); for (Method method : serviceInterface.getDeclaredMethods()) { Method previous = methodNames.put(method.getName(), method); if (previous != null) { throw new Error(format("found duplicate method name which can be confusing, please use different method name, method={}, previous={}", Methods.path(method), Methods.path(previous))); } validate(method); } } WebServiceInterfaceValidator(Class<?> serviceInterface, BeanClassValidator validator); void validate(); public RequestBeanReader requestBeanReader; public RequestBeanWriter requestBeanWriter; public ResponseBeanReader responseBeanReader; public ResponseBeanWriter responseBeanWriter; }
@Test void validate() { var validator = new WebServiceInterfaceValidator(TestWebService.class, new BeanClassValidator()); validator.validate(); }