@SuppressWarnings("unchecked") public void testProcessSendsBundleAndCallsOperationsApplicator() throws Exception { EventMessageBundle messages = new EventMessageBundle(ROBOT_NAME.toEmailAddress(), ""); messages.addEvent(new DocumentChangedEvent(null, null, ALEX.getAddress(), 0L, "b+1234")); when(eventGenerator.generateEvents( any(WaveletAndDeltas.class), anyMap(), any(EventDataConverter.class))).thenReturn(messages); OperationRequest op = new OperationRequest("wavelet.fetch", "op1"); List<OperationRequest> ops = Collections.singletonList(op); when(connector.sendMessageBundle( any(EventMessageBundle.class), eq(robot), any(ProtocolVersion.class))).thenReturn(ops); enqueueEmptyWavelet(); robot.run(); verify(connector).sendMessageBundle( any(EventMessageBundle.class), eq(robot), any(ProtocolVersion.class)); verify(operationApplicator).applyOperations( eq(ops), any(ReadableWaveletData.class), any(HashedVersion.class), eq(INITIALIZED_ACCOUNT)); }
@SuppressWarnings("unchecked") public void testProcessSendsBundleAndCallsOperationsApplicator() throws Exception { EventMessageBundle messages = new EventMessageBundle(ROBOT_NAME.toEmailAddress(), ""); messages.addEvent(new DocumentChangedEvent(null, null, ALEX.getAddress(), 0L, "b+1234")); when(eventGenerator.generateEvents( any(), anyMap(), any())).thenReturn(messages); OperationRequest op = new OperationRequest("wavelet.fetch", "op1"); List<OperationRequest> ops = Collections.singletonList(op); when(connector.sendMessageBundle( any(EventMessageBundle.class), eq(robot), any(ProtocolVersion.class))).thenReturn(ops); enqueueEmptyWavelet(); robot.run(); verify(connector).sendMessageBundle( any(EventMessageBundle.class), eq(robot), any(ProtocolVersion.class)); verify(operationApplicator).applyOperations( eq(ops), any(ReadableWaveletData.class), any(HashedVersion.class), eq(INITIALIZED_ACCOUNT)); }
&& !documentChangedEventGenerated && !gadgetStateChangeEvent) { DocumentChangedEvent apiEvent = new DocumentChangedEvent(null, null, deltaAuthor.getAddress(), deltaTimestamp, blip.getId()); addEvent(apiEvent, capabilities, blip.getId(), messages);
waveletData.addParticipant("foo@google.com"); BlipSubmittedEvent event1 = new BlipSubmittedEvent(null, null, "foo@test.com", 1l, "blip1"); DocumentChangedEvent event2 = new DocumentChangedEvent(null, null, "foo@test.com", 1l, "blip1"); WaveletTagsChangedEvent event3 = new WaveletTagsChangedEvent(null, null, "foo@test.com", 1l, "blip1");
waveletData.addParticipant("foo@google.com"); BlipSubmittedEvent event1 = new BlipSubmittedEvent(null, null, "foo@test.com", 1l, "blip1"); DocumentChangedEvent event2 = new DocumentChangedEvent(null, null, "foo@test.com", 1l, "blip1"); WaveletTagsChangedEvent event3 = new WaveletTagsChangedEvent(null, null, "foo@test.com", 1l, "blip1");