Search in sources :

Example 1 with DatabaseMetadata

use of org.eclipse.jnosql.mapping.DatabaseMetadata in project jnosql-diana by eclipse.

the class DatabaseMetadataTest method shouldReturnToString2.

@Test
public void shouldReturnToString2() {
    Database database = Mockito.mock(Database.class);
    Mockito.when(database.value()).thenReturn(DatabaseType.COLUMN);
    DatabaseMetadata metadata = DatabaseMetadata.of(database);
    assertEquals("COLUMN", metadata.toString());
}
Also used : Database(jakarta.nosql.mapping.Database) DatabaseMetadata(org.eclipse.jnosql.mapping.DatabaseMetadata) Test(org.junit.jupiter.api.Test)

Example 2 with DatabaseMetadata

use of org.eclipse.jnosql.mapping.DatabaseMetadata in project jnosql-diana by eclipse.

the class DatabaseMetadataTest method shouldReturnToString.

@Test
public void shouldReturnToString() {
    Database database = Mockito.mock(Database.class);
    Mockito.when(database.value()).thenReturn(DatabaseType.COLUMN);
    Mockito.when(database.provider()).thenReturn("column");
    DatabaseMetadata metadata = DatabaseMetadata.of(database);
    assertEquals("COLUMN@column", metadata.toString());
}
Also used : Database(jakarta.nosql.mapping.Database) DatabaseMetadata(org.eclipse.jnosql.mapping.DatabaseMetadata) Test(org.junit.jupiter.api.Test)

Example 3 with DatabaseMetadata

use of org.eclipse.jnosql.mapping.DatabaseMetadata in project jnosql-diana by eclipse.

the class DatabaseMetadataTest method shouldReturnMetadata.

@Test
public void shouldReturnMetadata() {
    Database database = Mockito.mock(Database.class);
    Mockito.when(database.value()).thenReturn(DatabaseType.COLUMN);
    Mockito.when(database.provider()).thenReturn("column");
    DatabaseMetadata metadata = DatabaseMetadata.of(database);
    assertEquals(DatabaseType.COLUMN, metadata.getType());
    assertEquals("column", metadata.getProvider());
}
Also used : Database(jakarta.nosql.mapping.Database) DatabaseMetadata(org.eclipse.jnosql.mapping.DatabaseMetadata) Test(org.junit.jupiter.api.Test)

Aggregations

Database (jakarta.nosql.mapping.Database)3 DatabaseMetadata (org.eclipse.jnosql.mapping.DatabaseMetadata)3 Test (org.junit.jupiter.api.Test)3