Skip to content

Commit

Permalink
creates tests
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviojava committed Oct 1, 2019
1 parent 550df23 commit fbbb0e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Expand Up @@ -17,6 +17,7 @@
import jakarta.nosql.document.DocumentCollectionManagerAsync;
import org.eclipse.jnosql.artemis.configuration.CDIExtension;
import org.eclipse.jnosql.artemis.configuration.ConfigurationException;
import org.eclipse.jnosql.artemis.configuration.document.DocumentConfigurationAsyncMock.DocumentCollectionManagerAsyncMock;
import org.eclipse.jnosql.artemis.configuration.document.DocumentConfigurationMock.DocumentCollectionManagerMock;
import org.eclipse.microprofile.config.Config;
import org.junit.jupiter.api.Assertions;
Expand Down Expand Up @@ -85,7 +86,7 @@ public void shouldReturnManager() {
System.setProperty(prefix + ".provider", DocumentConfigurationAsyncMock.class.getName());
System.setProperty(prefix + ".database", "database");
final DocumentCollectionManagerAsync manager = config.getValue(prefix, DocumentCollectionManagerAsync.class);
final DocumentCollectionManagerMock managerMock = DocumentCollectionManagerMock.class.cast(manager);
final DocumentCollectionManagerAsyncMock managerMock = DocumentCollectionManagerAsyncMock.class.cast(manager);
Assertions.assertEquals("database", managerMock.getDatabase());
System.clearProperty(prefix);
System.clearProperty(prefix + ".settings.key");
Expand Down
Expand Up @@ -41,8 +41,8 @@ public Settings getSettings() {


@Override
public DocumentCollectionManagerMock getAsync(String database) {
return new DocumentCollectionManagerMock(database);
public DocumentCollectionManagerAsyncMock getAsync(String database) {
return new DocumentCollectionManagerAsyncMock(database);
}

@Override
Expand All @@ -51,11 +51,11 @@ public void close() {
}
}

public static class DocumentCollectionManagerMock implements DocumentCollectionManagerAsync {
public static class DocumentCollectionManagerAsyncMock implements DocumentCollectionManagerAsync {

private final String database;

public DocumentCollectionManagerMock(String database) {
public DocumentCollectionManagerAsyncMock(String database) {
this.database = database;
}

Expand Down

0 comments on commit fbbb0e2

Please sign in to comment.