use of org.jnosql.diana.api.document.DocumentConfiguration in project jnosql-diana-driver by eclipse.
the class MongoDBDocumentConfigurationTest method shouldReturnErrorWhendSettingsIsNull.
@Test
public void shouldReturnErrorWhendSettingsIsNull() {
DocumentConfiguration configuration = new MongoDBDocumentConfiguration();
assertThrows(NullPointerException.class, () -> configuration.get(null));
}
use of org.jnosql.diana.api.document.DocumentConfiguration in project jnosql-artemis by eclipse.
the class DocumentCollectionFactoryProducer method getDocumentCollection.
private <T extends DocumentCollectionManager> DocumentCollectionManagerFactory<T> getDocumentCollection(InjectionPoint injectionPoint) {
Annotated annotated = injectionPoint.getAnnotated();
ConfigurationUnit annotation = getConfigurationUnit(injectionPoint, annotated).orElseThrow(() -> new IllegalStateException("The @ConfigurationUnit does not found"));
ConfigurationSettingsUnit unit = configurationReader.get().read(annotation, DocumentConfiguration.class);
Class<DocumentConfiguration> configurationClass = unit.<DocumentConfiguration>getProvider().orElseThrow(() -> new IllegalStateException("The DocumentConfiguration provider is required in the configuration"));
DocumentConfiguration configuration = reflections.newInstance(configurationClass);
return configuration.get(unit.getSettings());
}
use of org.jnosql.diana.api.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);
}
Aggregations