@Test public void testThatCreateJSModulesIsCalledOnAllPackages() { CompositeReactPackage composite = new CompositeReactPackage(packageNo1, packageNo2, packageNo3); composite.createJSModules(); verify(packageNo1).createJSModules(); verify(packageNo2).createJSModules(); verify(packageNo3).createJSModules(); }
@Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage.createJSModules()) { moduleSet.add(jsModule); } } return new ArrayList(moduleSet); }
CompositeReactPackage implements ReactPackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage.createJSModules()) { moduleSet.add(jsModule); } } return new ArrayList(moduleSet); } }
CompositeReactPackage implements ReactPackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage.createJSModules()) { moduleSet.add(jsModule); } } return new ArrayList(moduleSet); } CompositeReactPackage(ReactPackage arg1, ReactPackage arg2, ReactPackage... args); }
CompositeReactPackage implements ReactPackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage.createJSModules()) { moduleSet.add(jsModule); } } return new ArrayList(moduleSet); } CompositeReactPackage(ReactPackage arg1, ReactPackage arg2, ReactPackage... args); @Override List<NativeModule> createNativeModules(ReactApplicationContext reactContext); @Override List<Class<? extends JavaScriptModule>> createJSModules(); @Override List<ViewManager> createViewManagers(ReactApplicationContext reactContext); }
CompositeReactPackage implements ReactPackage { @Override public List<Class<? extends JavaScriptModule>> createJSModules() { final Set<Class<? extends JavaScriptModule>> moduleSet = new HashSet<>(); for (ReactPackage reactPackage: mChildReactPackages) { for (Class<? extends JavaScriptModule> jsModule: reactPackage.createJSModules()) { moduleSet.add(jsModule); } } return new ArrayList(moduleSet); } CompositeReactPackage(ReactPackage arg1, ReactPackage arg2, ReactPackage... args); @Override List<NativeModule> createNativeModules(ReactApplicationContext reactContext); @Override List<Class<? extends JavaScriptModule>> createJSModules(); @Override List<ViewManager> createViewManagers(ReactApplicationContext reactContext);  }