1. Project Clover database Wed Nov 12 2025 05:07:35 UTC
  2. Package guru.mikelue.foxglove.vendor

File MssqlTest.java

 

Code metrics

0
3
3
1
54
41
3
1
1
3
1

Classes

Class Line # Actions
MssqlTest 21 3 0% 3 6
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package guru.mikelue.foxglove.vendor;
2   
3    import java.io.IOException;
4   
5    import org.springframework.beans.factory.annotation.Autowired;
6    import org.springframework.context.ApplicationContext;
7    import org.springframework.jdbc.core.JdbcTemplate;
8    import org.springframework.transaction.annotation.Transactional;
9   
10    import org.junit.jupiter.api.BeforeAll;
11    import org.junit.jupiter.api.Tag;
12    import org.junit.jupiter.api.Test;
13   
14    import guru.mikelue.foxglove.TableFacet;
15    import guru.mikelue.foxglove.annotation.GenData;
16    import guru.mikelue.foxglove.annotation.TableFacetsSource;
17    import guru.mikelue.foxglove.jdbc.JdbcTableFacet;
18    import guru.mikelue.foxglove.test.AbstractVendorTestBase;
19   
20    @Tag("vendor-mssql")
 
21    public class MssqlTest extends AbstractVendorTestBase {
22    private final static int RANDOM_ROWS = gen().ints().range(5, 10).get();
23   
 
24  0 toggle public MssqlTest() {}
25   
 
26  0 toggle @BeforeAll
27    static void beforeAllSetup(
28    @Autowired ApplicationContext appContext,
29    @Autowired JdbcTemplate jdbcTemplate
30    ) throws IOException {
31  0 dropTables(jdbcTemplate, "ap_types");
32   
33  0 build("classpath:mssql-types.sql", appContext);
34    }
35   
36    @TableFacetsSource
37    TableFacet defaultData = JdbcTableFacet.builder("ap_types")
38    .numberOfRows(RANDOM_ROWS)
39    .column("tp_color").fixed("green")
40    .build();
41   
42    /**
43    * Tests basic functionality of Mysql database.
44    */
 
45  0 toggle @Test
46    @GenData @Transactional
47    void basic()
48    {
49  0 assertNumberOfRows(
50    "ap_types", "tp_color = 'green'"
51    )
52    .isEqualTo(RANDOM_ROWS);
53    }
54    }