ConsumerRegistration { public DatabusCombinedConsumer getConsumer() { int index = _rng.nextInt(_consumers.size()); return _consumers.get(index); } ConsumerRegistration(DatabusCombinedConsumer consumer, List<String> sources, DbusKeyCompositeFilterConfig filterConfig);  ConsumerRegistration(List<DatabusCombinedConsumer> consumers, List<String> sources, DbusKeyCompositeFilterConfig filterConfig); protected  ConsumerRegistration(DatabusCombinedConsumer consumer, List<DatabusCombinedConsumer> consumers,
		  List<DatabusSubscription> subs,
		  DbusKeyCompositeFilterConfig filterConfig); DatabusCombinedConsumer getConsumer(); List<DatabusCombinedConsumer> getConsumers(); List<String> getSources(); List<DatabusSubscription> getSubscriptions(); boolean checkSourceSubscription(DatabusSubscription sub); DbusKeyCompositeFilterConfig getFilterConfig(); static List<String> createStringFromAllSubscriptionFromRegistration(ConsumerRegistration reg);  }
@Test public void testSingleConsumer() throws Exception { DatabusCombinedConsumer logConsumer = new LoggingConsumer(); List<String> sources = new ArrayList<String>(); ConsumerRegistration consumerReg = new ConsumerRegistration(logConsumer, sources, null); Assert.assertEquals(logConsumer, consumerReg.getConsumer()); return; }
@Test public void testMultipleConsumers() throws Exception { DatabusCombinedConsumer logConsumer1 = new LoggingConsumer(); DatabusCombinedConsumer logConsumer2 = new LoggingConsumer(); List<DatabusCombinedConsumer> lcs = new ArrayList<DatabusCombinedConsumer>(); lcs.add(logConsumer1); lcs.add(logConsumer2); List<String> sources = new ArrayList<String>(); ConsumerRegistration consumerReg = new ConsumerRegistration(lcs, sources, null); DatabusStreamConsumer cons = consumerReg.getConsumer(); boolean condition = logConsumer1.equals(cons) || logConsumer2.equals(cons); Assert.assertEquals(condition, true); return; }