Search in sources :

Example 1 with ConfigPublishRequest

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());
}
Also used : ConfigPublishRequest(com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest) ConfigPublishResponse(com.alibaba.nacos.api.config.remote.response.ConfigPublishResponse) RequestMeta(com.alibaba.nacos.api.remote.request.RequestMeta) Test(org.junit.Test)

Example 2 with ConfigPublishRequest

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;
}
Also used : ConfigPublishRequest(com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest)

Example 3 with ConfigPublishRequest

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");
}
Also used : ConfigPublishRequest(com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest)

Example 4 with ConfigPublishRequest

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());
}
Also used : ConfigPublishRequest(com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest) MonitorKey(com.alibaba.nacos.core.remote.control.MonitorKey) Test(org.junit.Test)

Example 5 with ConfigPublishRequest

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());
}
Also used : ConfigPublishRequest(com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest) MonitorKey(com.alibaba.nacos.core.remote.control.MonitorKey) Test(org.junit.Test)

Aggregations

ConfigPublishRequest (com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest)5 Test (org.junit.Test)3 MonitorKey (com.alibaba.nacos.core.remote.control.MonitorKey)2 ConfigPublishResponse (com.alibaba.nacos.api.config.remote.response.ConfigPublishResponse)1 RequestMeta (com.alibaba.nacos.api.remote.request.RequestMeta)1