use of org.springframework.test.annotation.Rollback in project spring-data-document-examples by spring-projects.
the class CustomerRepositoryTests method testCheckOneEntity.
@Transactional
@Rollback(false)
@Test
public void testCheckOneEntity() {
Customer c = customerRepository.findOne(idUsed);
Assert.assertNotNull(c);
Assert.assertEquals("Nilsson", c.getLastName());
}
use of org.springframework.test.annotation.Rollback in project spring-data-document-examples by spring-projects.
the class CustomerRepositoryTests method testCheckOneEntityHasDocument.
@Transactional
@Rollback(false)
@Test
public void testCheckOneEntityHasDocument() {
Customer c = customerRepository.findOne(idUsed);
Assert.assertNotNull(c);
Assert.assertNotNull(c.getSurveyInfo());
Assert.assertNotNull(c.getSurveyInfo().getQuestionsAndAnswers());
Assert.assertEquals("22", c.getSurveyInfo().getQuestionsAndAnswers().get("age"));
}
use of org.springframework.test.annotation.Rollback in project ORCID-Source by ORCID.
the class OrcidOauth2AuthorizationDetailsDaoTest method testFindByAuthenticationKey.
@Test
@Transactional
@Rollback
public void testFindByAuthenticationKey() throws Exception {
List<OrcidOauth2TokenDetail> all = orcidOauth2TokenDetailDao.getAll();
assertEquals(5, all.size());
for (OrcidOauth2TokenDetail detail : all) {
OrcidOauth2TokenDetail another = orcidOauth2TokenDetailDao.findByTokenValue(detail.getTokenValue());
assertNotNull(another);
assertEquals(detail.getId(), another.getId());
assertTrue(detail.getTokenExpiration().after(new Date()));
assertTrue(detail.getRefreshTokenExpiration().after(new Date()));
}
}
use of org.springframework.test.annotation.Rollback in project ORCID-Source by ORCID.
the class OrcidOauth2AuthorizationDetailsDaoTest method testFindById.
@Test
@Transactional
@Rollback
public void testFindById() throws Exception {
List<OrcidOauth2TokenDetail> all = orcidOauth2TokenDetailDao.getAll();
assertEquals(5, all.size());
for (OrcidOauth2TokenDetail detail : all) {
OrcidOauth2TokenDetail another = orcidOauth2TokenDetailDao.find(detail.getId());
assertNotNull(another);
assertEquals(detail.getId(), another.getId());
assertTrue(detail.getTokenExpiration().after(new Date()));
String refreshTokenValue = detail.getRefreshTokenValue();
assertNotNull(refreshTokenValue);
}
}
use of org.springframework.test.annotation.Rollback in project ORCID-Source by ORCID.
the class OrcidOauth2AuthorizationDetailsDaoTest method testFindByRefreshTokenValue.
@Test
@Transactional
@Rollback
public void testFindByRefreshTokenValue() throws Exception {
List<OrcidOauth2TokenDetail> all = orcidOauth2TokenDetailDao.getAll();
assertEquals(5, all.size());
for (OrcidOauth2TokenDetail detail : all) {
String refreshToken = detail.getRefreshTokenValue();
OrcidOauth2TokenDetail another = orcidOauth2TokenDetailDao.findByRefreshTokenValue(refreshToken);
assertNotNull(another);
assertEquals(refreshToken, another.getRefreshTokenValue());
assertTrue(detail.getTokenExpiration().after(new Date()));
assertTrue(another.getRefreshTokenExpiration().after(new Date()));
}
}
Aggregations