| 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") |
| |
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 3 |
Complexity Density: 1 |
|
| 21 |
|
public class MssqlTest extends AbstractVendorTestBase { |
| 22 |
|
private final static int RANDOM_ROWS = gen().ints().range(5, 10).get(); |
| 23 |
|
|
| |
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
| 24 |
0 |
public MssqlTest() {}... |
| 25 |
|
|
| |
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 26 |
0 |
@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 |
|
|
| 44 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
4-
|
|
| 45 |
0 |
@Test... |
| 46 |
|
@GenData @Transactional |
| 47 |
|
void basic() |
| 48 |
|
{ |
| 49 |
0 |
assertNumberOfRows( |
| 50 |
|
"ap_types", "tp_color = 'green'" |
| 51 |
|
) |
| 52 |
|
.isEqualTo(RANDOM_ROWS); |
| 53 |
|
} |
| 54 |
|
} |