@Test public void getChannel() throws ChannelNotFoundException { final InMemoryDataStore store = new InMemoryDataStore(); store.saveChannel(mockChannel(UUIDUtil.newUAID(), "channel-1", 1, "endpointToken")); final Channel channel = store.getChannel("channel-1"); assertThat(channel, is(notNullValue())); assertThat(channel.getChannelId(), equalTo("channel-1")); assertThat(channel.getEndpointToken(), equalTo("endpointToken")); }
@Override public Channel getChannel(final String channelId) throws ChannelNotFoundException { checkNotNull(channelId, "channelId"); final Channel channel = channels.get(channelId); if (channel == null) { throw new ChannelNotFoundException("No Channel for [" + channelId + "] was found", channelId); } return channel; }
InMemoryDataStore implements DataStore { @Override public Channel getChannel(final String channelId) throws ChannelNotFoundException { checkNotNull(channelId, "channelId"); final Channel channel = channels.get(channelId); if (channel == null) { throw new ChannelNotFoundException("No Channel for [" + channelId + "] was found", channelId); } return channel; } }
InMemoryDataStore implements DataStore { @Override public Channel getChannel(final String channelId) throws ChannelNotFoundException { checkNotNull(channelId, "channelId"); final Channel channel = channels.get(channelId); if (channel == null) { throw new ChannelNotFoundException("No Channel for [" + channelId + "] was found", channelId); } return channel; }  }
InMemoryDataStore implements DataStore { @Override public Channel getChannel(final String channelId) throws ChannelNotFoundException { checkNotNull(channelId, "channelId"); final Channel channel = channels.get(channelId); if (channel == null) { throw new ChannelNotFoundException("No Channel for [" + channelId + "] was found", channelId); } return channel; }  @Override void savePrivateKeySalt(final byte[] salt); @Override byte[] getPrivateKeySalt(); @Override boolean saveChannel(final Channel ch); @Override Channel getChannel(final String channelId); @Override void removeChannels(final String uaid); @Override void removeChannels(final Set<String> channelIds); @Override Set<String> getChannelIds(final String uaid); @Override String updateVersion(final String endpointToken, final long version); @Override String saveUnacknowledged(final String channelId, final long version); @Override Set<Ack> getUnacknowledged(final String uaid); @Override Set<Ack> removeAcknowledged(final String uaid, final Set<Ack> acked); }
InMemoryDataStore implements DataStore { @Override public Channel getChannel(final String channelId) throws ChannelNotFoundException { checkNotNull(channelId, "channelId"); final Channel channel = channels.get(channelId); if (channel == null) { throw new ChannelNotFoundException("No Channel for [" + channelId + "] was found", channelId); } return channel; }  @Override void savePrivateKeySalt(final byte[] salt); @Override byte[] getPrivateKeySalt(); @Override boolean saveChannel(final Channel ch); @Override Channel getChannel(final String channelId); @Override void removeChannels(final String uaid); @Override void removeChannels(final Set<String> channelIds); @Override Set<String> getChannelIds(final String uaid); @Override String updateVersion(final String endpointToken, final long version); @Override String saveUnacknowledged(final String channelId, final long version); @Override Set<Ack> getUnacknowledged(final String uaid); @Override Set<Ack> removeAcknowledged(final String uaid, final Set<Ack> acked);  }