@Before public void init() { student = new Student(); student.setName("aaaa"); Classes c = new Classes(); c.setClassesName("bbbbb"); student.setClasses(c); }
@Test public void testSaveClasses() { assertTrue(classesDAO.count() == 0); Student tt = studentDAO.save(student); assertNotNull(tt); assertNotNull(tt.getClasses()); assertEquals(tt.getClasses().getClassesName(), "bbbbb"); classesDAO.findAll(); assertTrue(classesDAO.count() > 0); }