use of jakarta.nosql.Settings in project jnosql-diana by eclipse.
the class DefaultSettingsTest method shouldContainsKeys.
@Test
public void shouldContainsKeys() {
Settings settings = Settings.of(singletonMap("key", "value"));
assertTrue(settings.containsKey("key"));
assertFalse(settings.containsKey("key2"));
}
use of jakarta.nosql.Settings in project jnosql-diana by eclipse.
the class ColumnFamilyManagerFactoryConverterTest 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", ColumnConfigurationMock.class.getName());
final ColumnFamilyManagerFactory managerFactory = config.getValue(prefix, ColumnFamilyManagerFactory.class);
final ColumnConfigurationMock.ColumnFamilyManagerFactoryMock factoryMock = ColumnConfigurationMock.ColumnFamilyManagerFactoryMock.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");
}
use of jakarta.nosql.Settings 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");
}
use of jakarta.nosql.Settings in project jnosql-diana by eclipse.
the class BucketManagerFactoryConverterTest 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", KeyValueConfigurationMock.class.getName());
final BucketManagerFactory managerFactory = config.getValue(prefix, BucketManagerFactory.class);
final BucketManagerFactoryMock factoryMock = BucketManagerFactoryMock.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");
}
use of jakarta.nosql.Settings in project jnosql-diana-driver by eclipse.
the class CassandraConfigurationTest method shouldCreateDocumentEntityManagerFactoryFromSettings.
@Test
public void shouldCreateDocumentEntityManagerFactoryFromSettings() {
Settings settings = ManagerFactorySupplier.INSTANCE.getSettings();
CassandraConfiguration cassandraConfiguration = new CassandraConfiguration();
ColumnFamilyManagerFactory entityManagerFactory = cassandraConfiguration.get(settings);
assertNotNull(entityManagerFactory);
}
Aggregations