在grails 1.3.7中进行集成测试时,我正在模拟一个名为'scp'的方法,并发生以下异常:junit.framework.AssertionFailedError:此时不再需要调用'scp'.要求结束.
'scp'被叫了两次.它第一次工作,第二次抛出异常.
请先在这里发帖,请保持温柔.我正在使用Smack库构建一个Facebook聊天客户端.我正在使用X-FACEBOOK-PLATFORM方法,以免保存任何密码.我使用oauth 1.0正常工作,并希望将其更改为2.0,导致10月1日截止日期; p.根据我的理解,为了迁移到2.0,我必须做的唯一事情是删除"sig"和"session_key"参数并添加"access_token"参数,但我得到的是"SASL身份验证X-FACEBOOK- PLATFORM失败:未经授权:".我正在使用这个自定义SASLMechanism类:
package smackresearching;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Map;
import javax.security.sasl.Sasl;
import org.jivesoftware.smack.SASLAuthentication;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.sasl.SASLMechanism;
import org.jivesoftware.smack.util.Base64;
public class SASLXFacebookPlatformMechanism extends SASLMechanism {
public static final String NAME = "X-FACEBOOK-PLATFORM";
private String apiKey = "";
private String accessToken = "";
/**
* Constructor.
*/
public SASLXFacebookPlatformMechanism(SASLAuthentication saslAuthentication) {
super(saslAuthentication);
}
@Override
protected void authenticate() throws IOException, XMPPException {
// Send the authentication to the server
getSASLAuthentication().send(new AuthMechanism(getName(), ""));
}
@Override
public …Run Code Online (Sandbox Code Playgroud)