use of org.springframework.data.mongodb.examples.custsvc.domain.Customer in project spring-data-document-examples by spring-projects.
the class CustomerRepositoryTests method testInsertNewEntity.
@Transactional
@Test
public void testInsertNewEntity() {
Customer c = new Customer();
c.setFirstName("Sven");
c.setLastName("Svensson");
customerRepository.save(c);
List<Customer> results = customerRepository.findAll();
Assert.assertEquals(1, results.size());
}
use of org.springframework.data.mongodb.examples.custsvc.domain.Customer 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"));
}
Aggregations