MetaWeblog { public boolean editPost(Post post, boolean publish) throws XmlRpcException { if (post == null || post.getPostid() == null) { throw new IllegalArgumentException("post or Postid cannot be null!"); } Object[] pParams = {post.getPostid(), configInfo.getUserName(), configInfo.getPassword(), ReflectUtil.toXMLRPCParams(post), publish}; return (boolean) this.xmlRpcExecute.execute(configInfo.getServerUrl(), "metaWeblog.editPost", pParams); } MetaWeblog(); String newPost(String blogid, Post post, boolean publish); boolean editPost(Post post, boolean publish); @SuppressWarnings("unchecked") Post getPost(String postid); boolean deletePost(String postid); void setConfigInfo(ConfigInfo configInfo); ConfigInfo getConfigInfo();  }
@Test public void editPost() throws Exception { post.setPostid("1"); when(xmlRpcClient.execute(anyString(), any(Object[].class))).thenReturn(true); assertThat(metaWeblog.editPost(post, true)).isTrue(); }