use of com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest in project nacos by alibaba.
the class ConfigPublishRequestHandlerTest method testHandle.
@Test
public void testHandle() throws NacosException {
ConfigPublishRequest configPublishRequest = new ConfigPublishRequest();
configPublishRequest.setDataId("dataId");
configPublishRequest.setGroup("group");
configPublishRequest.setContent("content");
RequestMeta requestMeta = new RequestMeta();
requestMeta.setClientIp("127.0.0.1");
ConfigPublishResponse response = configPublishRequestHandler.handle(configPublishRequest, requestMeta);
Assert.assertEquals(ResponseCode.SUCCESS.getCode(), response.getResultCode());
}
use of com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest in project nacos by alibaba.
the class ConfigGrpcResourceParserTest method mockConfigRequest.
private Request mockConfigRequest(String tenant, String group, String dataId) {
ConfigPublishRequest request = new ConfigPublishRequest();
request.setTenant(tenant);
request.setGroup(group);
request.setDataId(dataId);
return request;
}
use of com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest in project nacos by alibaba.
the class GrpcProtocolAuthServiceTest method mockConfigRequest.
private void mockConfigRequest() {
configRequest = new ConfigPublishRequest();
configRequest.setTenant("testCNs");
configRequest.setGroup("testCG");
configRequest.setDataId("testD");
}
use of com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest in project nacos by alibaba.
the class ConfigPublishGroupKeyParserTest method testParse.
@Test
public void testParse() {
ConfigPublishRequest configPublishRequest = new ConfigPublishRequest();
configPublishRequest.setContent("content");
configPublishRequest.setRequestId("requestId");
configPublishRequest.setGroup("group");
configPublishRequest.setCasMd5("md5");
configPublishRequest.setDataId("dataId");
configPublishRequest.setTenant("tenant");
MonitorKey parse = configPublishGroupKeyParser.parse(configPublishRequest);
Assert.assertEquals("dataId+group+tenant", parse.getKey());
}
use of com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest in project nacos by alibaba.
the class ConfigPublishGroupParserTest method testParse.
@Test
public void testParse() {
ConfigPublishRequest configPublishRequest = new ConfigPublishRequest();
configPublishRequest.setContent("content");
configPublishRequest.setRequestId("requestId");
configPublishRequest.setGroup("group");
configPublishRequest.setCasMd5("md5");
configPublishRequest.setDataId("dataId");
configPublishRequest.setTenant("tenant");
MonitorKey parse = configPublishGroupParser.parse(configPublishRequest);
Assert.assertEquals("group", parse.getKey());
}
Aggregations