use of org.eclipse.jnosql.mapping.document.configuration.DocumentConfigurationMock.DocumentCollectionManagerMock in project jnosql-diana by eclipse.
the class DocumentCollectionManagerConverterTest method shouldReturnManager.
@Test
public void shouldReturnManager() {
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());
System.setProperty(prefix + ".database", "database");
final DocumentCollectionManager manager = config.getValue(prefix, DocumentCollectionManager.class);
final DocumentCollectionManagerMock managerMock = DocumentCollectionManagerMock.class.cast(manager);
Assertions.assertEquals("database", managerMock.getDatabase());
System.clearProperty(prefix);
System.clearProperty(prefix + ".settings.key");
System.clearProperty(prefix + ".settings.key2");
System.clearProperty(prefix + ".provider");
System.clearProperty(prefix + ".database");
}
Aggregations