@Test public void testFromFactory() throws Exception { expect(httpResourceGroupMock.newTemplateBuilder(anyObject(String.class))).andReturn(httpRequestTemplateBuilderMock).anyTimes(); expect(httpRequestTemplateBuilderMock.withMethod(anyObject(String.class))).andReturn(httpRequestTemplateBuilderMock).anyTimes(); expect(httpRequestTemplateBuilderMock.withUriTemplate(anyObject(String.class))).andReturn(httpRequestTemplateBuilderMock).anyTimes(); replayAll(); Map<Method, MethodTemplateExecutor> executorMap = MethodTemplateExecutor.from(httpResourceGroupMock, ShortMovieService.class, AnnotationProcessorsProvider.DEFAULT); assertEquals(ShortMovieService.class.getMethods().length, executorMap.size()); }
public static Map<Method, MethodTemplateExecutor> from(HttpResourceGroup httpResourceGroup, Class<?> clientInterface, AnnotationProcessorsProvider annotations) { MethodTemplate[] methodTemplates = MethodTemplate.from(clientInterface); Map<Method, MethodTemplateExecutor> tgm = new HashMap<Method, MethodTemplateExecutor>(); for (MethodTemplate mt : methodTemplates) { tgm.put(mt.getMethod(), new MethodTemplateExecutor(httpResourceGroup, mt, annotations)); } return tgm; }
MethodTemplateExecutor { public static Map<Method, MethodTemplateExecutor> from(HttpResourceGroup httpResourceGroup, Class<?> clientInterface, AnnotationProcessorsProvider annotations) { MethodTemplate[] methodTemplates = MethodTemplate.from(clientInterface); Map<Method, MethodTemplateExecutor> tgm = new HashMap<Method, MethodTemplateExecutor>(); for (MethodTemplate mt : methodTemplates) { tgm.put(mt.getMethod(), new MethodTemplateExecutor(httpResourceGroup, mt, annotations)); } return tgm; } }
MethodTemplateExecutor { public static Map<Method, MethodTemplateExecutor> from(HttpResourceGroup httpResourceGroup, Class<?> clientInterface, AnnotationProcessorsProvider annotations) { MethodTemplate[] methodTemplates = MethodTemplate.from(clientInterface); Map<Method, MethodTemplateExecutor> tgm = new HashMap<Method, MethodTemplateExecutor>(); for (MethodTemplate mt : methodTemplates) { tgm.put(mt.getMethod(), new MethodTemplateExecutor(httpResourceGroup, mt, annotations)); } return tgm; } MethodTemplateExecutor(HttpResourceGroup httpResourceGroup, MethodTemplate methodTemplate, AnnotationProcessorsProvider annotations); }
MethodTemplateExecutor { public static Map<Method, MethodTemplateExecutor> from(HttpResourceGroup httpResourceGroup, Class<?> clientInterface, AnnotationProcessorsProvider annotations) { MethodTemplate[] methodTemplates = MethodTemplate.from(clientInterface); Map<Method, MethodTemplateExecutor> tgm = new HashMap<Method, MethodTemplateExecutor>(); for (MethodTemplate mt : methodTemplates) { tgm.put(mt.getMethod(), new MethodTemplateExecutor(httpResourceGroup, mt, annotations)); } return tgm; } MethodTemplateExecutor(HttpResourceGroup httpResourceGroup, MethodTemplate methodTemplate, AnnotationProcessorsProvider annotations); @SuppressWarnings("unchecked") RibbonRequest<O> executeFromTemplate(Object[] args); static Map<Method, MethodTemplateExecutor> from(HttpResourceGroup httpResourceGroup, Class<?> clientInterface, AnnotationProcessorsProvider annotations); }
MethodTemplateExecutor { public static Map<Method, MethodTemplateExecutor> from(HttpResourceGroup httpResourceGroup, Class<?> clientInterface, AnnotationProcessorsProvider annotations) { MethodTemplate[] methodTemplates = MethodTemplate.from(clientInterface); Map<Method, MethodTemplateExecutor> tgm = new HashMap<Method, MethodTemplateExecutor>(); for (MethodTemplate mt : methodTemplates) { tgm.put(mt.getMethod(), new MethodTemplateExecutor(httpResourceGroup, mt, annotations)); } return tgm; } MethodTemplateExecutor(HttpResourceGroup httpResourceGroup, MethodTemplate methodTemplate, AnnotationProcessorsProvider annotations); @SuppressWarnings("unchecked") RibbonRequest<O> executeFromTemplate(Object[] args); static Map<Method, MethodTemplateExecutor> from(HttpResourceGroup httpResourceGroup, Class<?> clientInterface, AnnotationProcessorsProvider annotations);  }