@Test public void duplicateCheck() throws IOException, ParserConfigurationException, SAXException, LexerException, SecurityException, NoSuchMethodException { StatisticsAccessLog aclog = EasyMock .createMock(StatisticsAccessLog.class); ProcessingIndexFeeder feeder = createMock(ProcessingIndexFeeder.class); CacheManager cacheManager = CacheManagerBuilder.newCacheManagerBuilder().build(); cacheManager.init(); HazelcastServerNode.ensureHazelcastNode(); FedoraAccessAkubraImpl fa = createMockBuilder(FedoraAccessAkubraImpl.class) .withConstructor(KConfiguration.getInstance(), feeder, aclog, cacheManager) .addMockedMethod("isStreamAvailable") .addMockedMethod("getRelsExt") .createMock(); SolrAccess sa = createMockBuilder(SolrAccessImpl.class).createMock(); SolrMemoization memo = EasyMock.createMock(SolrMemoization.class); EasyMock.expect(memo.getRememberedIndexedDoc(DataPrepare.DROBNUSTKY_PIDS[0])).andReturn(null); EasyMock.expect(memo.askForIndexDocument(DataPrepare.DROBNUSTKY_PIDS[0])).andReturn(null); replay(fa, aclog, sa, memo); Injector injector = Guice.createInjector(new JSONDecTestModule(sa, memo, fa, null, null)); JSONDecoratorsAggregate aggregate = injector .getInstance(JSONDecoratorsAggregate.class); List<JSONDecorator> list = aggregate.getDecorators(); List<String> KEYS = new ArrayList<String>(); for (JSONDecorator jsonDecorator : list) { String key = jsonDecorator.getKey(); Assert.assertFalse(KEYS.contains(key)); KEYS.add(key); } }
public List<JSONDecorator> getDecorators() { List<JSONDecorator> decorators = new ArrayList<JSONDecorator>(); for (String k : this.keys) { decorators.add(this.decoratorsMap.get(k)); } return decorators; }
JSONDecoratorsAggregate { public List<JSONDecorator> getDecorators() { List<JSONDecorator> decorators = new ArrayList<JSONDecorator>(); for (String k : this.keys) { decorators.add(this.decoratorsMap.get(k)); } return decorators; } }
JSONDecoratorsAggregate { public List<JSONDecorator> getDecorators() { List<JSONDecorator> decorators = new ArrayList<JSONDecorator>(); for (String k : this.keys) { decorators.add(this.decoratorsMap.get(k)); } return decorators; } @Inject  JSONDecoratorsAggregate(Set<JSONDecorator> decs); }
JSONDecoratorsAggregate { public List<JSONDecorator> getDecorators() { List<JSONDecorator> decorators = new ArrayList<JSONDecorator>(); for (String k : this.keys) { decorators.add(this.decoratorsMap.get(k)); } return decorators; } @Inject  JSONDecoratorsAggregate(Set<JSONDecorator> decs); List<JSONDecorator> getDecorators(); }
JSONDecoratorsAggregate { public List<JSONDecorator> getDecorators() { List<JSONDecorator> decorators = new ArrayList<JSONDecorator>(); for (String k : this.keys) { decorators.add(this.decoratorsMap.get(k)); } return decorators; } @Inject  JSONDecoratorsAggregate(Set<JSONDecorator> decs); List<JSONDecorator> getDecorators();  }