|
|
|
@ -16,6 +16,10 @@ import xyz.wbsite.module.admin.req.ServicesCreateRequest;
|
|
|
|
|
import xyz.wbsite.module.admin.rsp.LocationsCreateResponse;
|
|
|
|
|
import xyz.wbsite.module.admin.rsp.ServicesCreateResponse;
|
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.AssertTrue;
|
|
|
|
|
|
|
|
|
|
import static junit.framework.TestCase.assertTrue;
|
|
|
|
|
|
|
|
|
|
@RunWith(SpringRunner.class)
|
|
|
|
|
@SpringBootTest
|
|
|
|
|
@Transactional
|
|
|
|
@ -35,11 +39,12 @@ public class DataInit {
|
|
|
|
|
servicesCreateRequest.setTitle("默认主机");
|
|
|
|
|
servicesCreateRequest.setDomain("location");
|
|
|
|
|
servicesCreateRequest.setPort(80);
|
|
|
|
|
servicesCreateRequest.setType("反向代理");
|
|
|
|
|
servicesCreateRequest.setValid(true);
|
|
|
|
|
servicesCreateRequest.setFilter(false);
|
|
|
|
|
servicesCreateRequest.setFilterConf("");
|
|
|
|
|
ServicesCreateResponse servicesCreateResponse = servicesManager.create(servicesCreateRequest, token);
|
|
|
|
|
|
|
|
|
|
assertTrue(!servicesCreateResponse.hasError());
|
|
|
|
|
{
|
|
|
|
|
LocationsCreateRequest locationsCreateRequest = new LocationsCreateRequest();
|
|
|
|
|
locationsCreateRequest.setServicesId(servicesCreateResponse.getId());
|
|
|
|
@ -49,7 +54,20 @@ public class DataInit {
|
|
|
|
|
locationsCreateRequest.setFilter(false);
|
|
|
|
|
locationsCreateRequest.setFilterConf("");
|
|
|
|
|
LocationsCreateResponse locationsCreateResponse = locationsManager.create(locationsCreateRequest, token);
|
|
|
|
|
assertTrue(!locationsCreateResponse.hasError());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String[] strings1 = {"worker_processes","auto", "处理进程数","(auto)|([0-9]*)"};
|
|
|
|
|
String[] strings2 = {"worker_connections","51200", "最大并发链接数","[0-9]*"};
|
|
|
|
|
String[] strings3 = {"keepalive_timeout","60", "连接超时时间","[0-9]*"};
|
|
|
|
|
String[] strings4 = {"gzip","60", "是否开启压缩传输","on|off"};
|
|
|
|
|
String[] strings5 = {"gzip_min_length","1", "KB,最小压缩文件","[0-9]*"};
|
|
|
|
|
String[] strings6 = {"gzip_comp_level","2", "压缩率","[0-9]*"};
|
|
|
|
|
String[] strings7 = {"client_max_body_size","100", "MB,最大上传文件","[0-9]*"};
|
|
|
|
|
String[] strings8 = {"server_names_hash_bucket_size","512", "服务器名字的hash表大小","[0-9]*"};
|
|
|
|
|
String[] strings9 = {"client_body_buffer_size","51200", "KB,请求主体缓冲区","[0-9]*"};
|
|
|
|
|
String[] strings10 = {"underscores_in_headers","on", "开启下划线头部信息","on|off"};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|