Search in sources :

Example 6 with Permission

use of indi.mybatis.flying.pojo.Permission in project mybatis.flying by limeng32.

the class WhiteListTest method testWhiteListInsertBatch.

@Test
@DatabaseSetup(connection = "dataSource1", type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/whiteListTest/testWhiteListInsertBatch.xml")
@ExpectedDatabase(connection = "dataSource1", override = false, assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/whiteListTest/testWhiteListInsertBatch.result.xml")
@DatabaseTearDown(connection = "dataSource1", type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/whiteListTest/testWhiteListInsertBatch.result.xml")
public void testWhiteListInsertBatch() {
    Account_ account = new Account_();
    account.setName("name");
    account.setEmail("email");
    account.setPassword("aaa");
    Role_ role = new Role_();
    role.setId(11);
    account.setRole(role);
    Permission permission = new Permission();
    permission.setId(22);
    account.setPermission(permission);
    Collection<Account_> ac = new ArrayList<>();
    ac.add(account);
    accountService.insertBatchSimpleNoName(ac);
}
Also used : Permission(indi.mybatis.flying.pojo.Permission) ArrayList(java.util.ArrayList) Account_(indi.mybatis.flying.pojo.Account_) Role_(indi.mybatis.flying.pojo.Role_) ExpectedDatabase(com.github.springtestdbunit.annotation.ExpectedDatabase) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) DatabaseSetup(com.github.springtestdbunit.annotation.DatabaseSetup) DatabaseTearDown(com.github.springtestdbunit.annotation.DatabaseTearDown)

Example 7 with Permission

use of indi.mybatis.flying.pojo.Permission in project mybatis.flying by limeng32.

the class JMHSpringBootTest method test4.

@Benchmark
public void test4() {
    Account_ a = new Account_();
    a.setId(1L);
    Permission p = new Permission();
    p.setSecret("a");
    a.setPermission(p);
    Collection<Account_> account = accountService.selectAll(a);
    Assert.assertNotNull(account);
}
Also used : Permission(indi.mybatis.flying.pojo.Permission) Account_(indi.mybatis.flying.pojo.Account_) Benchmark(org.openjdk.jmh.annotations.Benchmark)

Aggregations

Permission (indi.mybatis.flying.pojo.Permission)7 DatabaseSetup (com.github.springtestdbunit.annotation.DatabaseSetup)6 DatabaseTearDown (com.github.springtestdbunit.annotation.DatabaseTearDown)6 ExpectedDatabase (com.github.springtestdbunit.annotation.ExpectedDatabase)6 Account_ (indi.mybatis.flying.pojo.Account_)6 Test (org.junit.Test)6 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)6 Role_ (indi.mybatis.flying.pojo.Role_)3 AggregateModel (indi.mybatis.flying.models.AggregateModel)1 FlyingModel (indi.mybatis.flying.models.FlyingModel)1 Account_Condition (indi.mybatis.flying.pojo.condition.Account_Condition)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Benchmark (org.openjdk.jmh.annotations.Benchmark)1