EsScratchWordsServiceTest.java 2.0 KB

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