Search in sources :

Example 1 with OpenSessionRequest

use of org.roof.im.request.OpenSessionRequest in project roof-im by madfroglx.

the class OpenSessionTest method testSuccess.

@Test
public void testSuccess() throws Exception {
    OpenSessionRequest openSessionRequest = new OpenSessionRequest();
    openSessionRequest.setSender("abc");
    openSessionRequest.setReceiver("def");
    openSessionRequest.setToken("ab");
    openSessionRequest.setRequestType(RequestType.openSession.name());
    ValueStack valueStack = new GenericValueStack();
    valueStack.set(ImConstant.TEXT_MESSAGE, JSON.toJSONString(openSessionRequest));
    JSONObject jsonObjectMessage = JSON.parseObject(JSON.toJSONString(openSessionRequest));
    valueStack.set(ImConstant.JSON_OBJECT_MESSAGE, jsonObjectMessage);
    enterChain.doChain(valueStack);
}
Also used : OpenSessionRequest(org.roof.im.request.OpenSessionRequest) ValueStack(com.roof.chain.api.ValueStack) GenericValueStack(com.roof.chain.support.GenericValueStack) JSONObject(com.alibaba.fastjson.JSONObject) GenericValueStack(com.roof.chain.support.GenericValueStack) Test(org.junit.Test)

Aggregations

JSONObject (com.alibaba.fastjson.JSONObject)1 ValueStack (com.roof.chain.api.ValueStack)1 GenericValueStack (com.roof.chain.support.GenericValueStack)1 Test (org.junit.Test)1 OpenSessionRequest (org.roof.im.request.OpenSessionRequest)1