@Test public void configure() throws Exception { FileRegistryModule mod = new FileRegistryModule(FileUtils.getClasspathFile("registry-datasets.txt")); Injector inj = Guice.createInjector(mod); DatasetService ds = inj.getInstance(DatasetService.class); assertNull(ds.get(UUID.randomUUID())); OrganizationService os = inj.getInstance(OrganizationService.class); assertNull(os.get(UUID.randomUUID())); }
@Override protected void configure() { bind(DatasetService.class).toInstance(new DatasetServiceFileImpl(datasetFile)); bind(OrganizationService.class).toInstance(new OrganizationServiceEmptyImpl()); bind(InstallationService.class).toInstance(new InstallationServiceEmptyImpl()); bind(NetworkService.class).toInstance(new NetworkServiceEmptyImpl()); bind(NodeService.class).toInstance(new NodeServiceEmptyImpl()); }
FileRegistryModule extends AbstractModule { @Override protected void configure() { bind(DatasetService.class).toInstance(new DatasetServiceFileImpl(datasetFile)); bind(OrganizationService.class).toInstance(new OrganizationServiceEmptyImpl()); bind(InstallationService.class).toInstance(new InstallationServiceEmptyImpl()); bind(NetworkService.class).toInstance(new NetworkServiceEmptyImpl()); bind(NodeService.class).toInstance(new NodeServiceEmptyImpl()); } }
FileRegistryModule extends AbstractModule { @Override protected void configure() { bind(DatasetService.class).toInstance(new DatasetServiceFileImpl(datasetFile)); bind(OrganizationService.class).toInstance(new OrganizationServiceEmptyImpl()); bind(InstallationService.class).toInstance(new InstallationServiceEmptyImpl()); bind(NetworkService.class).toInstance(new NetworkServiceEmptyImpl()); bind(NodeService.class).toInstance(new NodeServiceEmptyImpl()); } FileRegistryModule(File datasetFile); }
FileRegistryModule extends AbstractModule { @Override protected void configure() { bind(DatasetService.class).toInstance(new DatasetServiceFileImpl(datasetFile)); bind(OrganizationService.class).toInstance(new OrganizationServiceEmptyImpl()); bind(InstallationService.class).toInstance(new InstallationServiceEmptyImpl()); bind(NetworkService.class).toInstance(new NetworkServiceEmptyImpl()); bind(NodeService.class).toInstance(new NodeServiceEmptyImpl()); } FileRegistryModule(File datasetFile);  }
FileRegistryModule extends AbstractModule { @Override protected void configure() { bind(DatasetService.class).toInstance(new DatasetServiceFileImpl(datasetFile)); bind(OrganizationService.class).toInstance(new OrganizationServiceEmptyImpl()); bind(InstallationService.class).toInstance(new InstallationServiceEmptyImpl()); bind(NetworkService.class).toInstance(new NetworkServiceEmptyImpl()); bind(NodeService.class).toInstance(new NodeServiceEmptyImpl()); } FileRegistryModule(File datasetFile);   }