From 0883bc9981f7b32c390ff474be9458e8620cd1d3 Mon Sep 17 00:00:00 2001 From: qianmoQ Date: Thu, 22 Sep 2022 13:51:01 +0800 Subject: [PATCH] api: Fix test units --- .../server/controller/ExecuteControllerTest.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/server/src/test/java/io/edurt/datacap/server/controller/ExecuteControllerTest.java b/server/src/test/java/io/edurt/datacap/server/controller/ExecuteControllerTest.java index d0689a51..71df3882 100644 --- a/server/src/test/java/io/edurt/datacap/server/controller/ExecuteControllerTest.java +++ b/server/src/test/java/io/edurt/datacap/server/controller/ExecuteControllerTest.java @@ -26,6 +26,10 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; @SpringBootTest @WebAppConfiguration @Slf4j +@SqlGroup(value = { + @Sql(value = "classpath:schema/source.sql"), + @Sql(value = "classpath:data/source.sql") +}) public class ExecuteControllerTest { @Autowired @@ -40,10 +44,6 @@ public class ExecuteControllerTest } @Test - @SqlGroup(value = { - @Sql(value = "classpath:schema/source.sql"), - @Sql(value = "classpath:data/source.sql") - }) public void execute() throws Exception { @@ -58,15 +58,12 @@ public class ExecuteControllerTest } @Test - @SqlGroup(value = { - @Sql(value = "classpath:schema/source.sql"), - @Sql(value = "classpath:data/source.sql") - }) public void executeFormatJson() throws Exception { ExecuteEntity entity = BaseParamTest.builderExecute(); entity.setFormat(FormatType.JSON); + entity.setName("MySQL1"); MvcResult mvcResult = mockMvc.perform(MockMvcRequestBuilders.post("/api/v1/execute") .contentType(MediaType.APPLICATION_JSON) .content(JSON.objectmapper.writeValueAsString(entity)))