mirror of
https://gitee.com/devlive-community/datacap.git
synced 2024-11-30 11:07:41 +08:00
api: Fix test units
This commit is contained in:
parent
482193173c
commit
0883bc9981
@ -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)))
|
||||
|
Loading…
Reference in New Issue
Block a user