Example #1
0
 @Test
 public void findByIdApp() {
   App app = new App();
   app.setUser(user);
   user.getUserApps().add(app);
   app.setAppName("Teste");
   app.setVersion("0.1");
   app.setiOSTheme(false);
   app = this.appDao.create(app);
   Assert.assertEquals(app, this.appDao.findById(app.getId()));
 }
Example #2
0
 @Test
 public void deleteApp() {
   App app = new App();
   app.setUser(user);
   user.getUserApps().add(app);
   app.setAppName("Teste");
   app.setVersion("0.1");
   app.setiOSTheme(false);
   Assert.assertEquals(0, this.appDao.findAll().size());
   app = this.appDao.create(app);
   Assert.assertEquals(1, this.appDao.findAll().size());
   this.appDao.delete(app);
   Assert.assertEquals(0, this.appDao.findAll().size());
   Assert.assertNull(this.appDao.findById(app.getId()));
 }
Example #3
0
 @Test
 public void createAppWithEmailUs() {
   App app = new App();
   app.setUser(user);
   user.getUserApps().add(app);
   app.setAppName("Teste");
   app.setVersion("0.1");
   EmailUs email = new EmailUs();
   email.setEmail("email");
   email.setApp(app);
   List<Function> function = new ArrayList<Function>();
   function.add(email);
   app.setAppFunctions(function);
   app.setiOSTheme(false);
   app = this.appDao.create(app);
   Assert.assertEquals(app, this.appDao.findById(app.getId()));
 }