refactor(接口测试): 去掉获取license接口

This commit is contained in:
AgAngle 2023-12-14 11:06:25 +08:00 committed by Craftsman
parent d8e0fd0bc7
commit 59c6581165
3 changed files with 0 additions and 50 deletions

View File

@ -63,8 +63,6 @@ public class FilterChainUtils {
// 获取插件中的图片
filterChainDefinitionMap.put("/plugin/image/**", "anon");
// task runner code
filterChainDefinitionMap.put("/task/runner/get/**", "anon");
return filterChainDefinitionMap;
}

View File

@ -1,24 +0,0 @@
package io.metersphere.api.controller;
import io.metersphere.sdk.util.CommonBeanFactory;
import io.metersphere.system.service.LicenseService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/task/runner")
@Tag(name = "执行开放API")
public class ApiTaskRunnerController {
@GetMapping("/get/{encrypt}")
public String getCode(@PathVariable String encrypt) {
LicenseService licenseService = CommonBeanFactory.getBean(LicenseService.class);
if (licenseService != null) {
return licenseService.getCode(encrypt);
}
return null;
}
}

View File

@ -1,24 +0,0 @@
package io.metersphere.api.controller;
import io.metersphere.system.base.BaseTest;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class ApiTaskRunnerControllerTests extends BaseTest {
private static final String BASE_PATH = "/task/runner/get/test-code";
@Test
@Order(0)
public void testCode() throws Exception {
// @@校验没有数据的情况
this.requestGetWithOk(BASE_PATH);
}
}