MongoDbUriSupplier implements Supplier<String> { static MongoDbUriSupplier of(final Config mongoDbConfig) { validate(mongoDbConfig); return new MongoDbUriSupplier(mongoDbConfig, tryToGetMongoDbSourceUri(mongoDbConfig.getString(URI_CONFIG_PATH))); } private  MongoDbUriSupplier(final Config theMongoDbConfig, final URI theMongoDbSourceUri); @Override String get();  }
@Test public void tryToGetInstanceWithNullConfig() { assertThatExceptionOfType(DittoConfigError.class) .isThrownBy(() -> MongoDbUriSupplier.of(null)) .withCause(new NullPointerException("The MongoDB Config must not be null!")); }
@Test public void tryToGetInstanceWithConfigWithoutUriPath() { assertThatExceptionOfType(DittoConfigError.class) .isThrownBy(() -> MongoDbUriSupplier.of(ConfigFactory.empty())) .withMessage("MongoDB Config did not have path <%s>!", KEY_URI) .withNoCause(); }