ServicioAuditoriaImpl implements AuditoriaService { public void audit(TrazaAuditoriaVO traza) { try { auditoriaManager.save(traza); } catch (Exception e) { auditoriaExceptionHandler.handleException(e, ExceptionMessageConstans.ERROR_SAVE); } }  AuditoriaManager getAuditoriaManager(); void setAuditoriaManager(AuditoriaManager auditoriaManager); AuditoriaExceptionHandler getAuditoriaExceptionHandler(); void setAuditoriaExceptionHandler(AuditoriaExceptionHandler auditoriaExceptionHandler); void audit(TrazaAuditoriaVO traza); Integer countByCriteria(CriteriaVO criteria); List<TrazaAuditoriaVO> findByCriteria(CriteriaVO criteria); TrazaAuditoriaVO getTraza(String idTraza); PaginatedList<TrazaAuditoriaVO> findByCriteria(CriteriaVO criteria,
			PaginationContext paginationContext); List<TrazaAuditoriaVO> findByAppIdEventType(Long appId, Long eventType, Date startDate,
			Date endDate); PaginatedList<TrazaAuditoriaVO> findByAppIdEventType(Long appId, Long eventType,
			Date startDate, Date endDate, PaginationContext paginationContext); List<TrazaAuditoriaVO> findByUserIdAppId(String userId, Long appId, Date startDate,
			Date endDate); PaginatedList<TrazaAuditoriaVO> findByUserIdAppId(String userId, Long appId,
			Date startDate, Date endDate, PaginationContext paginationContext); List<TrazaAuditoriaVO> findByUserId(String userId, Date startDate, Date endDate); PaginatedList<TrazaAuditoriaVO> findByUserId(String userId, Date startDate,
			Date endDate, PaginationContext paginationContext); List<TrazaAuditoriaVO> findByUserObjectId(String userId, Long appId, Long eventType,
			String objectId, Date startDate, Date endDate); PaginatedList<TrazaAuditoriaVO> findByUserObjectId(String userId, Long appId,
			Long eventType, String objectId, Date startDate, Date endDate,
			PaginationContext paginationContext); List<TrazaAuditoriaVO> findByUserObjectField(String userId, Long appId, Long eventType,
			String objectId, String objectField, Date startDate, Date endDate); PaginatedList<TrazaAuditoriaVO> findByUserObjectField(String userId, Long appId,
			Long eventType, String objectId, String objectField, Date startDate, Date endDate,
			PaginationContext paginationContext); List<TrazaAuditoriaVO> findByObjectId(Long appId, String objectId, Date startDate,
			Date endDate); PaginatedList<TrazaAuditoriaVO> findByObjectId(Long appId, String objectId,
			Date startDate, Date endDate, PaginationContext paginationContext); List<TrazaAuditoriaVO> findLikeObjectId(Long appId, String objectId, Date startDate,
			Date endDate); PaginatedList<TrazaAuditoriaVO> findLikeObjectId(Long appId, String objectId,
			Date startDate, Date endDate, PaginationContext paginationContext); List<TrazaAuditoriaVO> findLikeUserObjectId(String userId, Long appId, String objectId,
			Date startDate, Date endDate); PaginatedList<TrazaAuditoriaVO> findLikeUserObjectId(String userId, Long appId,
			String objectId, Date startDate, Date endDate, PaginationContext paginationContext); AppAuditoriaVO getAppAuditoria(String appDescripion);  }
@Test(expected = es.ieci.tecdoc.fwktd.audit.core.exception.AuditoriaException.class) public void testSaveKO() { TrazaAuditoriaVO traza1 = new TrazaAuditoriaVO(); traza1.setAppId(new Long(1)); traza1.setEventType(new Long(1)); traza1.setEventDate(new Date()); traza1.setUserId(null); traza1.setUserName("user name 1"); traza1.setUserHostName("user host name"); auditoriaService.audit(traza1); }