use of jakarta.nosql.document.DocumentConfiguration in project jnosql-diana by eclipse.
the class DocumentCollectionManagerFactoryConverter method success.
@Override
public DocumentCollectionManagerFactory success(String value) {
final SettingsConverter settingsConverter = BeanManagers.getInstance(SettingsConverter.class);
Config config = BeanManagers.getInstance(Config.class);
final Settings settings = settingsConverter.convert(value);
String provider = value + ".provider";
final Class<?> configurationClass = config.getValue(provider, Class.class);
if (DocumentConfiguration.class.isAssignableFrom(configurationClass)) {
final Reflections reflections = BeanManagers.getInstance(Reflections.class);
final DocumentConfiguration configuration = (DocumentConfiguration) reflections.newInstance(configurationClass);
return configuration.get(settings);
}
throw new ConfigurationException("The class " + configurationClass + " is not valid to " + DocumentConfiguration.class);
}
use of jakarta.nosql.document.DocumentConfiguration in project jnosql-diana-driver by eclipse.
the class CouchbaseDocumentConfigurationTest method shouldGetConfiguration.
@Test
public void shouldGetConfiguration() {
DocumentConfiguration configuration = DocumentConfiguration.getConfiguration();
Assertions.assertNotNull(configuration);
Assertions.assertTrue(configuration instanceof CouchbaseDocumentConfiguration);
}
use of jakarta.nosql.document.DocumentConfiguration in project jnosql-diana-driver by eclipse.
the class MongoDBDocumentConfigurationTest method shouldCreateDocumentCollectionManagerFactoryByFile.
@Test
public void shouldCreateDocumentCollectionManagerFactoryByFile() {
DocumentConfiguration configuration = new MongoDBDocumentConfiguration();
DocumentCollectionManagerFactory managerFactory = configuration.get();
assertNotNull(managerFactory);
}
use of jakarta.nosql.document.DocumentConfiguration in project jnosql-diana-driver by eclipse.
the class RavenDBDocumentConfigurationTest method shouldCreateDocumentCollectionManagerFactoryByFile.
@Test
public void shouldCreateDocumentCollectionManagerFactoryByFile() {
DocumentConfiguration configuration = new RavenDBDocumentConfiguration();
DocumentCollectionManagerFactory managerFactory = configuration.get();
assertNotNull(managerFactory);
}
use of jakarta.nosql.document.DocumentConfiguration in project jnosql-diana-driver by eclipse.
the class RavenDBDocumentConfigurationTest method shouldReturnErrorWhendSettingsIsNull.
@Test
public void shouldReturnErrorWhendSettingsIsNull() {
DocumentConfiguration configuration = new RavenDBDocumentConfiguration();
assertThrows(NullPointerException.class, () -> configuration.get(null));
}
Aggregations