use of com.github.springtestdbunit.annotation.ExpectedDatabase in project mybatis.flying by limeng32.
the class OrTest method testOr3.
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/orTest/testOr3.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/orTest/testOr3.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/orTest/testOr3.result.xml")
public void testOr3() {
LoginLog_Condition lc4 = new LoginLog_Condition();
Account_Condition2 ac = new Account_Condition2();
ac.setNameEqualsOr("ann", "bob");
lc4.setAccount(ac);
lc4.setIpLikeFilter("1");
int i4 = loginLogService.count(lc4);
Assert.assertEquals(2, i4);
}
use of com.github.springtestdbunit.annotation.ExpectedDatabase in project mybatis.flying by limeng32.
the class OrTest method testOr4.
@Test
@DatabaseSetup(type = DatabaseOperation.CLEAN_INSERT, value = "/indi/mybatis/flying/test/orTest/testOr4.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/orTest/testOr4.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/orTest/testOr4.result.xml")
public void testOr4() {
LoginLog_Condition lc = new LoginLog_Condition();
Account_Condition ac = new Account_Condition();
ac.setNameEqualsOrLoginlogIpEquals("ann", "bob", "c1");
lc.setAccount(ac);
int i1 = loginLogService.count(lc);
Assert.assertEquals(5, i1);
LoginLog_Condition lc2 = new LoginLog_Condition();
lc2.setAccount(new Account_Condition());
lc2.getAccount().setRole(new Role_Condition());
((Role_Condition) (lc2.getAccount().getRole())).setNameEqualsOrAccountNameEquals("admin", "cal");
int i2 = loginLogService.count(lc2);
Assert.assertEquals(6, i2);
}
use of com.github.springtestdbunit.annotation.ExpectedDatabase in project mybatis.flying by limeng32.
the class SelectOneTest method testSelectOne2.
/**
* 测试selectOne2
*/
@Test
@DatabaseSetup(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne2.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne2.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne2.result.xml")
public void testSelectOne2() {
Account_ a1 = new Account_();
a1.setName("ann");
a1.setEmail("ann@live.cn");
accountService.insert(a1);
Account_ a2 = new Account_();
a2.setName("ann");
a2.setEmail("bob@live.cn");
accountService.insert(a2);
Account_Condition ac = new Account_Condition();
ac.setLimiter(new PageParam(1, 2));
ac.setSorter(new SortParam(new Order("id", Sequence.asc)));
ac.setName("ann");
Account_ account = accountService.selectOne(ac);
Assert.assertEquals("ann@live.cn", account.getEmail());
Assert.assertNull(ac.getLimiter());
}
use of com.github.springtestdbunit.annotation.ExpectedDatabase in project mybatis.flying by limeng32.
the class SelectOneTest method testSelectOne1.
/**
* 测试selectOne1
*/
@Test
@DatabaseSetup(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne1.xml")
@ExpectedDatabase(assertionMode = DatabaseAssertionMode.NON_STRICT, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne1.result.xml")
@DatabaseTearDown(type = DatabaseOperation.DELETE_ALL, value = "/indi/mybatis/flying/test/selectOneTest/testSelectOne1.result.xml")
public void testSelectOne1() {
Account_ a1 = new Account_();
a1.setName("ann");
a1.setEmail("ann@live.cn");
accountService.insert(a1);
Account_ a2 = new Account_();
a2.setName("bob");
a2.setEmail("bob@live.cn");
accountService.insert(a2);
accountService.update(a2);
accountService.updatePersistent(a2);
Account_ account_ = accountService.select(a2.getId());
Account_ ac = new Account_();
ac.setName("bob");
ac.setEmail("bob@live.cn");
Account_ account = accountService.selectOne(ac);
Assert.assertEquals("bob@live.cn", account.getEmail());
}
use of com.github.springtestdbunit.annotation.ExpectedDatabase in project ArachneCentralAPI by OHDSI.
the class StudyControllerTests method testGetStudy.
@Test
@WithUserDetails(value = ADMIN_EMAIL)
@DatabaseSetup("/data/study/study-after-updating-description.xml")
@ExpectedDatabase(value = "/data/study/study-after-updating-description.xml", assertionMode = NON_STRICT)
public void testGetStudy() throws Exception {
MvcResult mvcResult = mvc.perform(get("/api/v1/study-management/studies/" + STUDY_ID)).andExpect(NO_ERROR_CODE).andExpect(jsonPath("$.result.id").isNotEmpty()).andReturn();
JSONAssert.assertEquals(UPDATED_STUDY_JSON_OBJECT, getResultJSONObject(mvcResult), false);
}
Aggregations