/** Test of authenticate method, of class PersonFacadeImpl. */ @Test public void testAuthenticate() { when(personDao.findByEmail(personHash.getEmail())).thenReturn(personHash); PersonAuthenticateDTO personAuthenticateDTO = new PersonAuthenticateDTO(); personAuthenticateDTO.setEmail(personDTOHash.getEmail()); personAuthenticateDTO.setPassword(personDTOHash.getPassword()); Assert.assertTrue(personFacade.authenticate(personAuthenticateDTO)); }
@BeforeMethod public void init() { person = new Person((long) 0, "prema@podlaha", "pass"); person.setAdmin(true); person2 = new Person((long) 1, "podlaha@podlaha", "aaaa"); person2.setAdmin(false); personDTO = beanMappingService.mapTo(person, PersonDTO.class); personDTO2 = beanMappingService.mapTo(person2, PersonDTO.class); personDTOHash = new PersonDTO((long) 2, "admin", "admin"); personDTOHash.setAdmin(true); personHash = new Person((long) 2, "admin", PersonServiceImpl.createHash("admin")); personHash.setAdmin(true); }
/** Test of edit method, of class PersonFacadeImpl. */ @Test public void testEdit() { when(personDao.findById(personDTO.getId())).thenReturn(person); personFacade.editPerson(personDTO); }