|
|
@@ -0,0 +1,61 @@
|
|
|
+package seecoder.devcloud.web.dao.pipeline;
|
|
|
+
|
|
|
+import org.junit.jupiter.api.Test;
|
|
|
+import org.junit.runner.RunWith;
|
|
|
+import org.mybatis.spring.annotation.MapperScan;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.boot.test.context.SpringBootTest;
|
|
|
+import org.springframework.test.context.junit4.SpringRunner;
|
|
|
+import seecoder.devcloud.web.model.po.pipeline.PipelinePO;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author PuHong Weng
|
|
|
+ * @date 2021/3/24
|
|
|
+ * @description:
|
|
|
+ */
|
|
|
+@RunWith(SpringRunner.class)
|
|
|
+@SpringBootTest
|
|
|
+@MapperScan(basePackages = {"seecoder.devcloud.web.dao"})
|
|
|
+class PipelineMapperTest {
|
|
|
+ private final PipelineMapper pipelineMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ PipelineMapperTest(PipelineMapper pipelineMapper) {
|
|
|
+ this.pipelineMapper = pipelineMapper;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void insert() {
|
|
|
+ PipelinePO po = PipelinePO.builder()
|
|
|
+ .configJson("tettst")
|
|
|
+ .name("tttsd")
|
|
|
+ .projectId(2)
|
|
|
+ .templateName("SPRINGBOOT-JAVA8")
|
|
|
+ .build();
|
|
|
+ pipelineMapper.insert(po, "id");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void selectById() {
|
|
|
+
|
|
|
+ System.out.println(pipelineMapper.selectById(4));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void selectByProjectId() {
|
|
|
+ System.out.println(pipelineMapper.selectByProjectId(2));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void delete() {
|
|
|
+ pipelineMapper.delete(5);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ void updateConfigJson() {
|
|
|
+ pipelineMapper.updateConfigJson(4,"gogogo");
|
|
|
+ }
|
|
|
+}
|