Search in sources :

Example 26 with ErrorResponse

use of com.alipay.sofa.jraft.rpc.RpcRequests.ErrorResponse in project sofa-jraft by sofastack.

the class NodeRequestProcessorTest method testPeerIdNotFound.

@Test
public void testPeerIdNotFound() {
    this.processor.handleRequest(asyncContext, TestUtils.createPingRequest());
    ErrorResponse resp = (ErrorResponse) asyncContext.getResponseObject();
    assertNotNull(resp);
    assertEquals(RaftError.ENOENT.getNumber(), resp.getErrorCode());
    assertEquals("Peer id not found: localhost:8081, group: test", resp.getErrorMsg());
}
Also used : ErrorResponse(com.alipay.sofa.jraft.rpc.RpcRequests.ErrorResponse) Test(org.junit.Test)

Aggregations

ErrorResponse (com.alipay.sofa.jraft.rpc.RpcRequests.ErrorResponse)26 Test (org.junit.Test)22 Message (com.google.protobuf.Message)8 Status (com.alipay.sofa.jraft.Status)6 PingRequest (com.alipay.sofa.jraft.rpc.RpcRequests.PingRequest)6 Node (com.alipay.sofa.jraft.Node)4 PeerId (com.alipay.sofa.jraft.entity.PeerId)4 RemotingException (com.alipay.sofa.jraft.error.RemotingException)3 NodeId (com.alipay.sofa.jraft.entity.NodeId)2 InvokeTimeoutException (com.alipay.sofa.jraft.error.InvokeTimeoutException)2 JRaftException (com.alipay.sofa.jraft.error.JRaftException)2 RpcClient (com.alipay.sofa.jraft.rpc.RpcClient)2 ExecutionException (java.util.concurrent.ExecutionException)2 RpcRequestCommand (com.alipay.remoting.rpc.protocol.RpcRequestCommand)1 RpcResponseCommand (com.alipay.remoting.rpc.protocol.RpcResponseCommand)1 NodeOptions (com.alipay.sofa.jraft.option.NodeOptions)1 GetLeaderRequest (com.alipay.sofa.jraft.rpc.CliRequests.GetLeaderRequest)1 GetLeaderResponse (com.alipay.sofa.jraft.rpc.CliRequests.GetLeaderResponse)1 GetPeersRequest (com.alipay.sofa.jraft.rpc.CliRequests.GetPeersRequest)1 GetPeersResponse (com.alipay.sofa.jraft.rpc.CliRequests.GetPeersResponse)1