### Question:
CouchDBDataStore implements DataStore { @Override public Channel getChannel(final String channelId) throws ChannelNotFoundException { return channelFromJson(getChannelJson(channelId)); } CouchDBDataStore(final String url, final String dbName); @Override void savePrivateKeySalt(final byte[] salt); @Override byte[] getPrivateKeySalt(); @Override boolean saveChannel(final Channel channel); @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);  }### Answer:
@Test (expected = ChannelNotFoundException.class) public void getChannelNonExisting() throws ChannelNotFoundException { datastore.getChannel(UUID.randomUUID().toString()); }
@Test public void getChannel() throws ChannelNotFoundException { final String uaid = UUIDUtil.newUAID(); final String channelId = UUID.randomUUID().toString(); final Channel channel = newChannel(uaid, channelId); datastore.saveChannel(channel); final Channel retreived = datastore.getChannel(channelId); assertThat(retreived.getUAID(), is(equalTo(channel.getUAID()))); assertThat(retreived.getChannelId(), is(equalTo(channel.getChannelId()))); assertThat(retreived.getEndpointToken(), is(equalTo(channel.getEndpointToken()))); assertThat(retreived.getVersion(), is(channel.getVersion())); }