Search in sources :

Example 1 with DocumentCollectionManagerFactory

use of jakarta.nosql.document.DocumentCollectionManagerFactory in project jnosql-diana by eclipse.

the class DocumentCollectionFactoryConverterTest method shouldReturnManagerFactory.

@Test
public void shouldReturnManagerFactory() {
    final String prefix = UUID.randomUUID().toString();
    System.setProperty(prefix, prefix);
    System.setProperty(prefix + ".settings.key", "value");
    System.setProperty(prefix + ".settings.key2", "value2");
    System.setProperty(prefix + ".provider", DocumentConfigurationMock.class.getName());
    final DocumentCollectionManagerFactory managerFactory = config.getValue(prefix, DocumentCollectionManagerFactory.class);
    final DocumentCollectionManagerFactoryMock factoryMock = DocumentCollectionManagerFactoryMock.class.cast(managerFactory);
    final Settings settings = factoryMock.getSettings();
    assertEquals(2, settings.size());
    assertEquals(settings.get("key").get(), "value");
    assertEquals(settings.get("key2").get(), "value2");
    assertNotNull(managerFactory);
    System.clearProperty(prefix);
    System.clearProperty(prefix + ".settings.key");
    System.clearProperty(prefix + ".settings.key2");
    System.clearProperty(prefix + ".provider");
}
Also used : DocumentCollectionManagerFactory(jakarta.nosql.document.DocumentCollectionManagerFactory) DocumentCollectionManagerFactoryMock(org.eclipse.jnosql.mapping.document.configuration.DocumentConfigurationMock.DocumentCollectionManagerFactoryMock) Settings(jakarta.nosql.Settings) Test(org.junit.jupiter.api.Test)

Example 2 with DocumentCollectionManagerFactory

use of jakarta.nosql.document.DocumentCollectionManagerFactory in project jnosql-diana-driver by eclipse.

the class CouchbaseDocumentConfigurationTest method shouldCreateDocumentCollectionManagerFactoryByMap.

@Test
public void shouldCreateDocumentCollectionManagerFactoryByMap() {
    CouchbaseDocumentConfiguration configuration = new CouchbaseDocumentConfiguration();
    DocumentCollectionManagerFactory managerFactory = configuration.get();
    assertNotNull(managerFactory);
}
Also used : DocumentCollectionManagerFactory(jakarta.nosql.document.DocumentCollectionManagerFactory) Test(org.junit.jupiter.api.Test)

Example 3 with DocumentCollectionManagerFactory

use of jakarta.nosql.document.DocumentCollectionManagerFactory in project jnosql-diana-driver by eclipse.

the class CouchbaseDocumentConfigurationTest method shouldCreateDocumentCollectionManagerFactoryByFile.

@Test
public void shouldCreateDocumentCollectionManagerFactoryByFile() {
    CouchbaseDocumentConfiguration configuration = new CouchbaseDocumentConfiguration();
    DocumentCollectionManagerFactory managerFactory = configuration.get();
    assertNotNull(managerFactory);
}
Also used : DocumentCollectionManagerFactory(jakarta.nosql.document.DocumentCollectionManagerFactory) Test(org.junit.jupiter.api.Test)

Example 4 with DocumentCollectionManagerFactory

use of jakarta.nosql.document.DocumentCollectionManagerFactory in project jnosql-diana-driver by eclipse.

the class ElasticsearchDocumentConfigurationTest method shouldCreateDocumentCollectionManagerFactoryByMap.

@Test
public void shouldCreateDocumentCollectionManagerFactoryByMap() {
    DocumentCollectionManagerFactory managerFactory = ElasticsearchDocumentCollectionManagerFactorySupplier.INSTANCE.get();
    assertNotNull(managerFactory);
}
Also used : DocumentCollectionManagerFactory(jakarta.nosql.document.DocumentCollectionManagerFactory) Test(org.junit.jupiter.api.Test)

Example 5 with DocumentCollectionManagerFactory

use of jakarta.nosql.document.DocumentCollectionManagerFactory 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);
}
Also used : DocumentCollectionManagerFactory(jakarta.nosql.document.DocumentCollectionManagerFactory) DocumentConfiguration(jakarta.nosql.document.DocumentConfiguration) Test(org.junit.jupiter.api.Test)

Aggregations

DocumentCollectionManagerFactory (jakarta.nosql.document.DocumentCollectionManagerFactory)16 Test (org.junit.jupiter.api.Test)15 DocumentConfiguration (jakarta.nosql.document.DocumentConfiguration)3 HashMap (java.util.HashMap)2 Settings (jakarta.nosql.Settings)1 DocumentCollectionManagerFactoryMock (org.eclipse.jnosql.mapping.document.configuration.DocumentConfigurationMock.DocumentCollectionManagerFactoryMock)1 Config (org.eclipse.microprofile.config.Config)1