@Test
@SuppressWarnings("unchecked")
public void testWithoutClassLoader() throws Exception {

    // Create parameters map
    final Map<String, String> parameters = (Map<String, String>) Map$.MODULE$.<String, String>newBuilder()
        .$plus$eq(new Tuple2<>("dbtable", "mytable"))
        .$plus$eq(new Tuple2<>("url", "jdbc:h2:mem:spark"))
        .result();
    // Test creating a JDBC relation
    try (final Connection conn = DriverManager.getConnection("jdbc:h2:mem:spark"); final Statement stmt = conn.createStatement()) {
        stmt.execute("CREATE TABLE mytable (col1 VARCHAR)");
        final JdbcRelationProvider provider = new JdbcRelationProvider();
        final JdbcRelation relation = (JdbcRelation) provider.createRelation(Mockito.mock(SQLContext.class), parameters);
        Assert.assertEquals(JDBCRelation.class, relation.getDelegate().getClass());
        Assert.assertNull("Expected null class loader", relation.getLoader());
    }
}