ChannelServiceTest.java 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package com.qs.mp.service;
  2. import com.qs.mp.MpApplication;
  3. import com.qs.mp.channel.domain.Channel;
  4. import com.qs.mp.channel.domain.vo.ChannelVO;
  5. import com.qs.mp.channel.service.IChannelService;
  6. import java.util.ArrayList;
  7. import java.util.List;
  8. import org.junit.jupiter.api.Test;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
  11. import org.springframework.boot.test.context.SpringBootTest;
  12. import org.springframework.test.context.ActiveProfiles;
  13. import org.springframework.test.context.TestPropertySource;
  14. @AutoConfigureMockMvc
  15. @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = MpApplication.class)
  16. @TestPropertySource(locations = "classpath:application-dev.yml")
  17. @ActiveProfiles("dev")
  18. public class ChannelServiceTest {
  19. @Autowired
  20. private IChannelService channelService;
  21. @Test
  22. public void testListChannel() {
  23. Channel channel = new Channel();
  24. channel.setParentId(1L);
  25. List<ChannelVO> list = new ArrayList<ChannelVO>();
  26. list = channelService.selectChannelVoList(channel,"channel");
  27. System.out.println("result:"+list.toString());
  28. }
  29. @Test
  30. public void testAddChannel() {
  31. Channel channel = new Channel();
  32. }
  33. @Test
  34. public void testEditChannel() {
  35. Channel channel = new Channel();
  36. }
  37. }