CarpaccioManager implements MappingManager.MappingManagerCallback { public Object bindView(View view, String mapName, int position) { if (mappingManager != null) { List<View> subViews = carpaccioSubViews.get(view); if (subViews != null) { Object mappedObject = mappingManager.getMappedListsObject(mapName, position); CarpaccioLogger.d(TAG, "bindView " + mapName + " position=" + position + " object=" + mappedObject); executeActionsOnViews(subViews, mappedObject); return mappedObject; } } return null; } CarpaccioManager(MappingManager mappingManager); void addView(View view); boolean isCarpaccioControlledView(View view); void registerController(Object controller); void registerControllers(Context context, String registerString); void executeActionsOnViews(); void executeActionsOnViews(List<View> views, Object mappedObject); void executeActionsOnView(View view); void executeActionsOnView(View view, Object mappedObject); void callActionOnView(CarpaccioAction action, View view); void mapObject(String name, Object object); Object getMappedObject(String name); void mapList(String mappedName, List list); void appendList(String mappedName, List list); List getMappedList(String name); Object registerAdapter(String mapName, Object adapter); T getAdapter(String mappedName); void addChildViews(View view); Object bindView(View view, String mapName, int position); Object bindView(View view, String mapName); void notifyAdapterDataSetChanded(Object adapter); void findCarpaccioControlledViews(View view); void findCarpaccioControlledViews(View view, List<View> listAddTo);  }
@Test public void testBindViews() throws Exception { ViewGroup viewGroup = mock(ViewGroup.class); View view = mock(View.class); doReturn(new Object()).when(mappingManager).getMappedListsObject("users",0); carpaccioManager.carpaccioSubViews.put(viewGroup, Arrays.asList(view)); carpaccioManager.bindView(viewGroup, "users", 0); verify(mappingManager, atLeastOnce()).getMappedListsObject(eq("users"), eq(0)); verify(view,atLeastOnce()).getTag(); }