AbstractDataServiceVisitor implements ElementVisitor<String, Writer> ,ProcessorConstants { List<String> getArgumentsType(ExecutableElement methodElement) { ExecutableType methodType = (ExecutableType) methodElement.asType(); List<String> res = new ArrayList<>(); for (TypeMirror argumentType : methodType.getParameterTypes()) { res.add(argumentType.toString()); } return res; } AbstractDataServiceVisitor(ProcessingEnvironment environment); @Override String visitType(TypeElement typeElement, Writer writer); @Override String visit(Element e, Writer p); @Override String visit(Element e); @Override String visitPackage(PackageElement e, Writer p); @Override String visitVariable(VariableElement e, Writer p); @Override String visitExecutable(ExecutableElement e, Writer p); @Override String visitTypeParameter(TypeParameterElement e, Writer p); @Override String visitUnknown(Element e, Writer p);  }
@Test public void testGetArgumentsType() { System.out.println("getArgumentsType"); ExecutableElement methodElement = mock(ExecutableElement.class); ExecutableType methodType = mock(ExecutableType.class); TypeMirror var0 = mock(TypeMirror.class); TypeMirror var1 = mock(TypeMirror.class); List ves = Arrays.asList(var0, var1); when(methodElement.asType()).thenReturn(methodType); when(var0.toString()).thenReturn("boolean"); when(var1.toString()).thenReturn("java.lang.String"); when(methodType.getParameterTypes()).thenReturn(ves); List<String> expResult = Arrays.asList("boolean", "java.lang.String"); List<String> result = instance.getArgumentsType(methodElement); assertThat(result).isEqualTo(expResult); }