EsScratchWordsServiceTest.java 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package cn.cslg.pas.service;
  2. import cn.cslg.pas.common.dto.QueryScratchWordsDTO;
  3. import cn.cslg.pas.common.dto.business.UpdateScratchWordsDTO;
  4. import cn.cslg.pas.domain.business.ScratchWords;
  5. import cn.cslg.pas.domain.es.Marking;
  6. import cn.cslg.pas.domain.es.Patent;
  7. import cn.cslg.pas.service.business.es.EsScratchWordsService;
  8. import cn.cslg.pas.service.business.es.EsService;
  9. import org.apache.ibatis.annotations.Update;
  10. import org.joda.time.DateTime;
  11. import org.junit.Test;
  12. import org.junit.runner.RunWith;
  13. import org.springframework.beans.BeanUtils;
  14. import org.springframework.beans.factory.annotation.Autowired;
  15. import org.springframework.boot.test.context.SpringBootTest;
  16. import org.springframework.test.context.junit4.SpringRunner;
  17. import java.util.Date;
  18. /**
  19. * @author chenyu
  20. * @date 2023/9/6
  21. */
  22. @SpringBootTest
  23. @RunWith(SpringRunner.class)
  24. public class EsScratchWordsServiceTest {
  25. @Autowired
  26. private EsScratchWordsService esScratchWordsService;
  27. @Autowired
  28. private EsService esService;
  29. @Test
  30. public void addPatent() throws Exception {
  31. ScratchWords scratchWords = new ScratchWords();
  32. scratchWords.setPatentNo("CN201721042063.9");
  33. scratchWords.setPublicTenantId(1);
  34. scratchWords.setMarkUserId("1");
  35. scratchWords.setIsPublic(true);
  36. scratchWords.setMarkColor("#qeqrqr");
  37. scratchWords.setMarkNoteText("测试标引");
  38. scratchWords.setMarkSite(10);
  39. scratchWords.setMarkTime(new Date());
  40. scratchWords.setPublicScope(1);
  41. esScratchWordsService.addScratchWords(scratchWords);
  42. }
  43. @Test
  44. public void getPatent() throws Exception {
  45. }
  46. @Test
  47. public void test() throws Exception {
  48. UpdateScratchWordsDTO updateScratchWordsDTO =new UpdateScratchWordsDTO();
  49. updateScratchWordsDTO.setIsPublic(true);
  50. Marking marking =new Marking();
  51. BeanUtils.copyProperties(updateScratchWordsDTO,marking);
  52. System.out.println(marking);
  53. }
  54. @Test
  55. public void remove() throws Exception{
  56. esScratchWordsService.removeById("noU2_YwBmzIo81_4JOrU");
  57. }
  58. @Test
  59. public void group() throws Exception{
  60. }
  61. }