@Test(expected = IllegalArgumentException.class) public void testWithUnknownSource() { addBeanClass(MyBeanReceivingString.class); initialize(); InMemoryConnector bean = container.getBeanManager().createInstance() .select(InMemoryConnector.class, ConnectorLiteral.of(InMemoryConnector.CONNECTOR)).get(); assertThat(bean).isNotNull(); bean.source("unknown"); }
public <T> InMemorySource<T> source(String channel) { if (channel == null) { throw ex.illegalArgumentChannelMustNotBeNull(); } InMemorySourceImpl<?> source = sources.get(channel); if (source == null) { throw ex.illegalArgumentUnknownChannel(channel); } return (InMemorySource<T>) source; }
InMemoryConnector implements IncomingConnectorFactory, OutgoingConnectorFactory { public <T> InMemorySource<T> source(String channel) { if (channel == null) { throw ex.illegalArgumentChannelMustNotBeNull(); } InMemorySourceImpl<?> source = sources.get(channel); if (source == null) { throw ex.illegalArgumentUnknownChannel(channel); } return (InMemorySource<T>) source; } }
InMemoryConnector implements IncomingConnectorFactory, OutgoingConnectorFactory { public <T> InMemorySource<T> source(String channel) { if (channel == null) { throw ex.illegalArgumentChannelMustNotBeNull(); } InMemorySourceImpl<?> source = sources.get(channel); if (source == null) { throw ex.illegalArgumentUnknownChannel(channel); } return (InMemorySource<T>) source; }  }
InMemoryConnector implements IncomingConnectorFactory, OutgoingConnectorFactory { public <T> InMemorySource<T> source(String channel) { if (channel == null) { throw ex.illegalArgumentChannelMustNotBeNull(); } InMemorySourceImpl<?> source = sources.get(channel); if (source == null) { throw ex.illegalArgumentUnknownChannel(channel); } return (InMemorySource<T>) source; }  static Map<String, String> switchIncomingChannelsToInMemory(String... channels); static Map<String, String> switchOutgoingChannelsToInMemory(String... channels); static void clear(); @Override PublisherBuilder<? extends Message<?>> getPublisherBuilder(Config config); @Override SubscriberBuilder<? extends Message<?>, Void> getSubscriberBuilder(Config config); InMemorySource<T> source(String channel); InMemorySink<T> sink(String channel); }
InMemoryConnector implements IncomingConnectorFactory, OutgoingConnectorFactory { public <T> InMemorySource<T> source(String channel) { if (channel == null) { throw ex.illegalArgumentChannelMustNotBeNull(); } InMemorySourceImpl<?> source = sources.get(channel); if (source == null) { throw ex.illegalArgumentUnknownChannel(channel); } return (InMemorySource<T>) source; }  static Map<String, String> switchIncomingChannelsToInMemory(String... channels); static Map<String, String> switchOutgoingChannelsToInMemory(String... channels); static void clear(); @Override PublisherBuilder<? extends Message<?>> getPublisherBuilder(Config config); @Override SubscriberBuilder<? extends Message<?>, Void> getSubscriberBuilder(Config config); InMemorySource<T> source(String channel); InMemorySink<T> sink(String channel); static final String CONNECTOR; }