DataServiceVisitorJsBuilder extends AbstractDataServiceVisitor { void createMethodBody(String classname, ExecutableElement methodElement, List<String> arguments, Writer writer) throws IOException { String methodName = getMethodName(methodElement); boolean ws = isWebsocketDataService(methodElement); String args = stringJoinAndDecorate(arguments, COMMA, new NothingDecorator()); String keys = computeKeys(methodElement, arguments); createReturnOcelotPromiseFactory(classname, methodName, ws, args, keys, writer); } DataServiceVisitorJsBuilder(ProcessingEnvironment environment, FwkWriter fwk);   }
@Test public void testCreateMethodBody() throws IOException { System.out.println("createMethodBody"); String classname = "CLASSNAME"; ExecutableElement executableElement = mock(ExecutableElement.class); List<String> arguments = mock(List.class); Writer writer = mock(Writer.class); doReturn("METHODNAME").when(instance).getMethodName(eq(executableElement)); doReturn("ARGS").when(instance).stringJoinAndDecorate(eq(arguments), eq(","), any(NothingDecorator.class)); doReturn("PARAMNAMES").when(instance).stringJoinAndDecorate(eq(arguments), eq(","), any(QuoteDecorator.class)); doReturn("KEYS").when(instance).computeKeys(eq(executableElement), eq(arguments)); doNothing().when(instance).createReturnOcelotPromiseFactory(any(String.class), any(String.class), any(Boolean.class), any(String.class), any(String.class), any(Writer.class)); instance.createMethodBody(classname, executableElement, arguments, writer); verify(instance).createReturnOcelotPromiseFactory(any(String.class), any(String.class), any(Boolean.class), any(String.class), any(String.class), any(Writer.class)); }