@Test public void testThatCreateNativeModulesIsCalledOnAllPackages() { CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2, packageNo3); composite.createNativeModules(reactContext); verify(packageNo1).createNativeModules(reactContext); verify(packageNo2).createNativeModules(reactContext); verify(packageNo3).createNativeModules(reactContext); }
@Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNativeModules(reactContext)) { moduleMap.put(nativeModule.getName(), nativeModule); } } return new ArrayList(moduleMap.values()); }
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNativeModules(reactContext)) { moduleMap.put(nativeModule.getName(), nativeModule); } } return new ArrayList(moduleMap.values()); } }
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNativeModules(reactContext)) { moduleMap.put(nativeModule.getName(), nativeModule); } } return new ArrayList(moduleMap.values()); } CompositeReactPackage(ReactPackage arg1, ReactPackage arg2, ReactPackage... args); }
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNativeModules(reactContext)) { moduleMap.put(nativeModule.getName(), nativeModule); } } return new ArrayList(moduleMap.values()); } CompositeReactPackage(ReactPackage arg1, ReactPackage arg2, ReactPackage... args); @Override List<NativeModule> createNativeModules(ReactApplicationContext reactContext); @Override List<NativeModule> createNativeModules(
      ReactApplicationContext reactContext,
      ReactInstanceManager reactInstanceManager); @Override List<ViewManager> createViewManagers(ReactApplicationContext reactContext); }
CompositeReactPackage extends ReactInstancePackage { @Override public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { final Map<String, NativeModule> moduleMap = new HashMap<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (NativeModule nativeModule: reactPackage.createNativeModules(reactContext)) { moduleMap.put(nativeModule.getName(), nativeModule); } } return new ArrayList(moduleMap.values()); } CompositeReactPackage(ReactPackage arg1, ReactPackage arg2, ReactPackage... args); @Override List<NativeModule> createNativeModules(ReactApplicationContext reactContext); @Override List<NativeModule> createNativeModules(
      ReactApplicationContext reactContext,
      ReactInstanceManager reactInstanceManager); @Override List<ViewManager> createViewManagers(ReactApplicationContext reactContext);  }