Search in sources :

Example 1 with DocumentCollectionManagerMock

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");
}
Also used : DocumentCollectionManager(jakarta.nosql.document.DocumentCollectionManager) DocumentCollectionManagerMock(org.eclipse.jnosql.mapping.document.configuration.DocumentConfigurationMock.DocumentCollectionManagerMock) Test(org.junit.jupiter.api.Test)

Aggregations

DocumentCollectionManager (jakarta.nosql.document.DocumentCollectionManager)1 DocumentCollectionManagerMock (org.eclipse.jnosql.mapping.document.configuration.DocumentConfigurationMock.DocumentCollectionManagerMock)1 Test (org.junit.jupiter.api.Test)1