YarProtocolUtil { public static YarResponse buildDefaultErrorResponse(String errMsg, String packagerName) { YarResponse yarResponse = new YarResponse(); yarResponse.setPackagerName(packagerName); yarResponse.setError(errMsg); yarResponse.setStatus("500"); return yarResponse; }  static String getYarPath(Class<?> interfaceClazz, URL url); static Request convert(YarRequest yarRequest, Class<?> interfaceClass); static YarRequest convert(Request request, String packagerName); static Response convert(YarResponse yarResponse); static YarResponse convert(Response response, String packagerName); static YarResponse buildDefaultErrorResponse(String errMsg, String packagerName);  }
@Test public void testBuildDefaultErrorResponse() { String errMsg = "test err"; String packagerName = "MSGPACK"; YarResponse response = YarProtocolUtil.buildDefaultErrorResponse(errMsg, packagerName); assertNotNull(response); assertEquals(errMsg, response.getError()); assertEquals(packagerName, response.getPackagerName()); }