Search in sources :

Example 1 with GetRequest

use of com.alibaba.nacos.consistency.entity.GetRequest in project nacos by alibaba.

the class ProtoMessageUtilTest method testConvertToReadRequest.

@Test
public void testConvertToReadRequest() {
    ByteString data = ByteString.copyFrom("data".getBytes());
    String group = "test";
    GetRequest getRequest = GetRequest.newBuilder().setGroup(group).setData(data).putExtendInfo("k", "v").build();
    ReadRequest readRequest = ProtoMessageUtil.convertToReadRequest(getRequest);
    assertEquals(group, readRequest.getGroup());
    assertEquals(data, readRequest.getData());
    assertEquals(1, readRequest.getExtendInfoCount());
}
Also used : ByteString(com.google.protobuf.ByteString) GetRequest(com.alibaba.nacos.consistency.entity.GetRequest) ByteString(com.google.protobuf.ByteString) ReadRequest(com.alibaba.nacos.consistency.entity.ReadRequest) Test(org.junit.Test)

Aggregations

GetRequest (com.alibaba.nacos.consistency.entity.GetRequest)1 ReadRequest (com.alibaba.nacos.consistency.entity.ReadRequest)1 ByteString (com.google.protobuf.ByteString)1 Test (org.junit.Test)1