MasterConfigSource extends AbstractSource<ConfigItem<?>> implements ConfigSource { @Override @SuppressWarnings("unchecked") public <R> R getConfig(final Class<R> clazz, final UniqueId uniqueId) { final ConfigItem<?> item = getMaster().get(uniqueId).getConfig(); if (clazz.isAssignableFrom(item.getType())) { return (R) item.getValue(); } else { return null; } } MasterConfigSource(final ConfigMaster configMaster); ConfigMaster getMaster(); @Override ChangeManager changeManager(); List<ConfigItem<R>> search(final ConfigSearchRequest<R> request); @Override @SuppressWarnings("unchecked") R getConfig(final Class<R> clazz, final UniqueId uniqueId); @Override ConfigItem<?> get(final ObjectId objectId, final VersionCorrection versionCorrection); @Override ConfigItem<?> get(final UniqueId uniqueId); @Override R getSingle(final Class<R> clazz, final String configName, final VersionCorrection versionCorrection); @SuppressWarnings("unchecked") @Override R getConfig(final Class<R> clazz, final ObjectId objectId, final VersionCorrection versionCorrection); @Override Collection<ConfigItem<R>> get(final Class<R> clazz, final String configName, final VersionCorrection versionCorrection); @Override Collection<ConfigItem<R>> getAll(final Class<R> clazz, final VersionCorrection versionCorrection); @Override R getLatestByName(final Class<R> clazz, final String name); @Override Map<UniqueId, ConfigItem<?>> get(final Collection<UniqueId> uniqueIds); @Override String toString();  }
@Test(expectedExceptions = DataNotFoundException.class) public void accessInvalidDocument() throws Exception { _configSource.getConfig(UniqueId.class, UniqueId.of("U", "1")); }