@Override protected void setUp() { MockitoAnnotations.initMocks(this); conversationUtil = new ConversationUtil(idGenerator); digester = new WaveDigester(conversationUtil); }
@Override protected void setUp() { MockitoAnnotations.initMocks(this); conversationUtil = new ConversationUtil(idGenerator); digester = new WaveDigester(conversationUtil); }
@Override protected void setUp() { service = CreateWaveletService.create(); waveletProvider = mock(WaveletProvider.class); converter = mock(EventDataConverter.class); waveletData = mock(WaveletData.class); when(waveletData.getWaveId()).thenReturn(TEMP_WAVE_ID); when(waveletData.getWaveletId()).thenReturn(WAVELET_ID); when(waveletData.getRootBlipId()).thenReturn("b+root"); ConversationUtil conversationUtil = new ConversationUtil(FakeIdGenerator.create()); context = new OperationContextImpl(waveletProvider, converter, conversationUtil); operation = new OperationRequest(OperationType.ROBOT_CREATE_WAVELET.method(), OPERATION_ID, Parameter.of(ParamsProperty.WAVELET_DATA, waveletData), Parameter.of(ParamsProperty.MESSAGE, MESSAGE)); }
@Override protected void setUp() { service = CreateWaveletService.create(); waveletProvider = mock(WaveletProvider.class); converter = mock(EventDataConverter.class); waveletData = mock(WaveletData.class); when(waveletData.getWaveId()).thenReturn(TEMP_WAVE_ID); when(waveletData.getWaveletId()).thenReturn(WAVELET_ID); when(waveletData.getRootBlipId()).thenReturn("b+root"); ConversationUtil conversationUtil = new ConversationUtil(FakeIdGenerator.create()); context = new OperationContextImpl(waveletProvider, converter, conversationUtil); operation = new OperationRequest(OperationType.ROBOT_CREATE_WAVELET.method(), OPERATION_ID, Parameter.of(ParamsProperty.WAVELET_DATA, waveletData), Parameter.of(ParamsProperty.MESSAGE, MESSAGE)); }
when(waveViewProvider.retrievePerUserWaveView(SHARED_USER)).thenReturn(wavesViewUser3); ConversationUtil conversationUtil = new ConversationUtil(idGenerator); WaveDigester digester = new WaveDigester(conversationUtil);
when(waveViewProvider.retrievePerUserWaveView(SHARED_USER)).thenReturn(wavesViewUser3); ConversationUtil conversationUtil = new ConversationUtil(idGenerator); WaveDigester digester = new WaveDigester(conversationUtil);
/** * Constructs a new {@link OperationServiceHelper} with a wavelet with the * name and participant that are passed in. * * @param waveletName the name of the empty wavelet to open in the context. * @param participant the participant that should be on that empty wavelet. */ public OperationServiceHelper(WaveletName waveletName, ParticipantId participant) { waveletProvider = mock(WaveletProvider.class); EventDataConverter converter = new EventDataConverterV22(); ObservableWaveletData waveletData = WaveletDataImpl.Factory.create(DOCUMENT_FACTORY).create( new EmptyWaveletSnapshot(waveletName.waveId, waveletName.waveletId, participant, HASH_FACTORY.createVersionZero(waveletName), 0L)); waveletData.addParticipant(participant); BasicWaveletOperationContextFactory CONTEXT_FACTORY = new BasicWaveletOperationContextFactory(participant); SilentOperationSink<WaveletOperation> executor = SilentOperationSink.Executor.<WaveletOperation, WaveletData>build(waveletData); OpBasedWavelet wavelet = new OpBasedWavelet(waveletData.getWaveId(), waveletData, CONTEXT_FACTORY, ParticipationHelper.DEFAULT, executor, SilentOperationSink.VOID); // Make a conversation with an empty root blip WaveletBasedConversation.makeWaveletConversational(wavelet); ConversationUtil conversationUtil = new ConversationUtil(FakeIdGenerator.create()); ObservableConversation conversation = conversationUtil.buildConversation(wavelet).getRoot(); conversation.getRootThread().appendBlip(); context = new OperationContextImpl(waveletProvider, converter, conversationUtil); context.putWavelet(waveletName.waveId, waveletName.waveletId, new RobotWaveletData(waveletData, HASH_FACTORY.createVersionZero(waveletName))); }
@Override protected void setUp() throws Exception { conversationUtil = new ConversationUtil(FakeIdGenerator.create()); eventGenerator = new EventGenerator(ROBOT_NAME, conversationUtil); waveletData = WaveletDataImpl.Factory.create(DOCUMENT_FACTORY).create( new EmptyWaveletSnapshot(WAVELET_NAME.waveId, WAVELET_NAME.waveletId, ALEX, HASH_FACTORY.createVersionZero(WAVELET_NAME), 0L)); // Robot should be participant in snapshot before deltas // otherwise events will be filtered out. waveletData.addParticipant(ROBOT); waveletData.addParticipant(ALEX); waveletData.setVersion(1); SilentOperationSink<WaveletOperation> executor = SilentOperationSink.Executor.<WaveletOperation, WaveletData> build(waveletData); output = new CapturingOperationSink<WaveletOperation>(); wavelet = new OpBasedWavelet(waveletData.getWaveId(), waveletData, CONTEXT_FACTORY, ParticipationHelper.DEFAULT, executor, output); // Make a conversation and clear the sink WaveletBasedConversation.makeWaveletConversational(wavelet); conversationUtil.buildConversation(wavelet).getRoot().getRootThread().appendBlip(); output.clear(); }
@Override protected void setUp() throws Exception { conversationUtil = new ConversationUtil(FakeIdGenerator.create()); eventGenerator = new EventGenerator(ROBOT_NAME, conversationUtil); waveletData = WaveletDataImpl.Factory.create(DOCUMENT_FACTORY).create( new EmptyWaveletSnapshot(WAVELET_NAME.waveId, WAVELET_NAME.waveletId, ALEX, HASH_FACTORY.createVersionZero(WAVELET_NAME), 0L)); // Robot should be participant in snapshot before deltas // otherwise events will be filtered out. waveletData.addParticipant(ROBOT); waveletData.addParticipant(ALEX); waveletData.setVersion(1); SilentOperationSink<WaveletOperation> executor = SilentOperationSink.Executor.<WaveletOperation, WaveletData> build(waveletData); output = new CapturingOperationSink<WaveletOperation>(); wavelet = new OpBasedWavelet(waveletData.getWaveId(), waveletData, CONTEXT_FACTORY, ParticipationHelper.DEFAULT, executor, output); // Make a conversation and clear the sink WaveletBasedConversation.makeWaveletConversational(wavelet); conversationUtil.buildConversation(wavelet).getRoot().getRootThread().appendBlip(); output.clear(); }