NetconfRpcReplyMessage extends NetconfPayload { public static <T extends RpcReply> String buildRpcReplyError(Class<T> replyClass, String messageId, RpcError rpcError) { return buildRpcReplyContext(replyClass, messageId, reply -> { reply.setRpcError(rpcError); }); } private  NetconfRpcReplyMessage();  NetconfRpcReplyMessage(String netconfMessage); static List<Object> getRpcReplyPayloadObjects(RpcReply rpcReply); static List<Document> getRpcReplyPayloads(RpcReply rpcReply); static RpcReply getRpcReply(String netconfMessage); RpcReply getRpcReply(); static String buildRpcReplyOkV10(String messageId); static String buildRpcReplyOkV11(String messageId); static String buildRpcReplyDataV10(String messageId, List<Node> nodes); static String buildRpcReplyDataV11(String messageId, List<Node> nodes); static String buildRpcReplyErrorV10(String messageId, RpcError rpcError); static String buildRpcReplyErrorV11(String messageId, RpcError rpcError); static String buildRpcReplyOk(Class<T> replyClass, String messageId); static String buildRpcReplyData(Class<T> replyClass,
                                                                String messageId, List<Object> objects); static String buildRpcReplyError(Class<T> replyClass,
                                                                 String messageId, RpcError rpcError);  }
@Test public void buildRpcReplyError() throws Exception { RpcError rpcError = new RpcError(); rpcError.setErrorTag("error-type"); rpcError.setErrorInfo(new ErrorInfo()); rpcError.setErrorMessage("error-message"); rpcError.setErrorType("error-type"); String reply = NetconfRpcReplyMessage.buildRpcReplyErrorV10(MESSAGE_ID, rpcError); assertTrue(reply.contains(V10)); assertTrue(reply.contains("error")); reply = NetconfRpcReplyMessage.buildRpcReplyErrorV11(MESSAGE_ID, rpcError); assertTrue(reply.contains(V11)); assertTrue(reply.contains("error")); }