### Question:
AuditLogServiceImpl extends AbstractBaseService<AuditLogEntity> implements AuditLogService { @Override public long insert(AuditLogEntity entity) { log.info("tbname_{}_refid_{},content is {},by {}", entity.getTbName(), entity.getRefId(), entity.getContent().replaceAll(" ", "_").replaceAll("\\|", "_").replaceAll("\\.", "_"), entity.getInsertBy()); try { if(entity.getContent()!=null&&entity.getContent().length()>5000) { log.info("log_insert_spec"); entity.setContent(entity.getContent().substring(0,5000)); } return super.insert(entity); } catch (Exception e) { log.error("log_insert", e); return 0; } }  @Override long insert(AuditLogEntity entity); @Override long getMindId(); @Override void deleteBy(Long minId); @Override void recordAudit(String tbName, long refId, String content); @Override AuditLogResponse logList(AuditLogRequest auditLogRequest);  }### Answer:
@Test public void insertTest() { AuditLogServiceImpl auditLogServiceImpl=new AuditLogServiceImpl(); UserInfoHolder userInfoHolder=mock(UserInfoHolder.class); AuditLogRepository auditLogRepository=mock(AuditLogRepository.class); ReflectionTestUtils.setField(auditLogServiceImpl, "userInfoHolder", userInfoHolder); ReflectionTestUtils.setField(auditLogServiceImpl, "auditLogRepository", auditLogRepository); auditLogServiceImpl.init(); AuditLogEntity entity=new AuditLogEntity(); entity.setContent("test"); entity.setId(1L); entity.setRefId(1L); auditLogServiceImpl.insert(entity); verify(auditLogRepository).insert(entity); }