public void testAppendBlip() throws Exception { OperationRequest operation = operationRequest(OperationType.WAVELET_APPEND_BLIP, Parameter.of(ParamsProperty.BLIP_DATA, blipData)); OperationContextImpl context = helper.getContext(); service.execute(operation, context, ALEX); JsonRpcResponse response = context.getResponse(OPERATION_ID); assertFalse(response.isError()); ObservableConversation conversation = context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot(); ConversationBlip newBlip = checkAndGetNewBlip(context, conversation, response); Iterator<? extends ObservableConversationBlip> it = conversation.getRootThread().getBlips().iterator(); it.next(); // skip, root assertEquals("New blip should be the second blip in the root thread", newBlip, it.next()); }
public void testAppendBlip() throws Exception { OperationRequest operation = operationRequest(OperationType.WAVELET_APPEND_BLIP, Parameter.of(ParamsProperty.BLIP_DATA, blipData)); OperationContextImpl context = helper.getContext(); service.execute(operation, context, ALEX); JsonRpcResponse response = context.getResponse(OPERATION_ID); assertFalse(response.isError()); ObservableConversation conversation = context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot(); ConversationBlip newBlip = checkAndGetNewBlip(context, conversation, response); Iterator<? extends ObservableConversationBlip> it = conversation.getRootThread().getBlips().iterator(); it.next(); // skip, root assertEquals("New blip should be the second blip in the root thread", newBlip, it.next()); }
public void testContinueThread() throws Exception { OperationContextImpl context = helper.getContext(); ObservableConversation conversation = context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot(); // Append a random blip to check that we actually append to the end of this // thread. conversation.getRootThread().appendBlip(); // Append to continue the thread of the root blip String rootBlipId = ConversationUtil.getRootBlipId(conversation); OperationRequest operation = operationRequest(OperationType.BLIP_CONTINUE_THREAD, rootBlipId, Parameter.of(ParamsProperty.BLIP_DATA, blipData)); service.execute(operation, context, ALEX); JsonRpcResponse response = context.getResponse(OPERATION_ID); assertFalse(response.isError()); ConversationBlip newBlip = checkAndGetNewBlip(context, conversation, response); Iterator<? extends ObservableConversationBlip> it = conversation.getRootThread().getBlips().iterator(); it.next(); // skip, root it.next(); // skip, first reply assertEquals("New blip should be the third blip in the root thread", newBlip, it.next()); }
public void testContinueThread() throws Exception { OperationContextImpl context = helper.getContext(); ObservableConversation conversation = context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot(); // Append a random blip to check that we actually append to the end of this // thread. conversation.getRootThread().appendBlip(); // Append to continue the thread of the root blip String rootBlipId = ConversationUtil.getRootBlipId(conversation); OperationRequest operation = operationRequest(OperationType.BLIP_CONTINUE_THREAD, rootBlipId, Parameter.of(ParamsProperty.BLIP_DATA, blipData)); service.execute(operation, context, ALEX); JsonRpcResponse response = context.getResponse(OPERATION_ID); assertFalse(response.isError()); ConversationBlip newBlip = checkAndGetNewBlip(context, conversation, response); Iterator<? extends ObservableConversationBlip> it = conversation.getRootThread().getBlips().iterator(); it.next(); // skip, root it.next(); // skip, first reply assertEquals("New blip should be the third blip in the root thread", newBlip, it.next()); }