VenService extends AbstractUserService<Ven> { public Ven prepare(String username, String password) { return super.prepare(new Ven(), username, password, digestAuthenticationProvider.getRealm()); }  Ven prepare(String username, String password); Ven prepare(String username); Ven prepare(VenCreateDto dto); Optional<File> generateCertificateIfRequired(VenCreateDto dto, Ven ven); @Override @Transactional void delete(Ven instance); @Override void delete(Iterable<Ven> instances); @Override Ven save(Ven instance); @Override void save(Iterable<Ven> instances); Ven findOneByUsername(String username); Ven findOneByRegistrationId(String registrationId); List<Ven> findByUsernameInAndVenMarketContextsContains(List<String> username,
			VenMarketContext venMarketContext); List<Ven> findByGroupName(List<String> groupName); List<Ven> findByMarketContextName(List<String> groupName); Ven findOne(Long id); Iterable<Ven> findAll(); long count(); void cleanRegistration(Ven ven); Page<Ven> search(List<VenFilter> filters); Page<Ven> search(List<VenFilter> filters, Integer page, Integer size);  }
@Test public void prepareTest() { String username = "ven1"; Ven prepare = venService.prepare(username); assertNotNull(prepare); assertNull(prepare.getId()); assertNull(prepare.getBasicPassword()); assertNull(prepare.getDigestPassword()); assertEquals(username, prepare.getUsername()); venService.save(prepare); assertNotNull(prepare); assertNotNull(prepare.getId()); assertNull(prepare.getBasicPassword()); assertNull(prepare.getDigestPassword()); assertEquals(username, prepare.getUsername()); venService.delete(prepare); prepare = venService.prepare(username, "ven1"); assertNotNull(prepare); assertNull(prepare.getId()); assertNotNull(prepare.getBasicPassword()); assertNotNull(prepare.getDigestPassword()); assertEquals(username, prepare.getUsername()); String profil = "20a"; String transport = "http"; VenCreateDto dto = new VenCreateDto(); dto.setUsername(username); dto.setPassword("ven1"); dto.setOadrProfil(profil); dto.setTransport(transport); prepare = venService.prepare(dto); assertNotNull(prepare); assertNull(prepare.getId()); assertNotNull(prepare.getBasicPassword()); assertNotNull(prepare.getDigestPassword()); assertEquals(username, prepare.getUsername()); assertEquals(profil, prepare.getOadrProfil()); assertEquals(transport, prepare.getTransport()); }