use of org.springframework.data.mongodb.examples.custsvc.domain.SurveyInfo in project spring-data-document-examples by spring-projects.
the class CustomerRepositoryTests method testInsertOneEntity.
@Transactional
@Rollback(false)
@Test
public void testInsertOneEntity() {
Customer c = new Customer();
c.setFirstName("Sven");
c.setLastName("Olafsen");
SurveyInfo surveyInfo = new SurveyInfo();
Map<String, String> qAndA = new HashMap<String, String>();
qAndA.put("age", "22");
qAndA.put("married", "Yes");
qAndA.put("citizenship", "Norwegian");
surveyInfo.setQuestionsAndAnswers(qAndA);
c.setSurveyInfo(surveyInfo);
customerRepository.save(c);
Assert.assertNotNull(c.getId());
idUsed = c.getId();
}
Aggregations