@Override public void onBlipDeleted(ObservableConversationBlip blip) { if (capabilities.containsKey(EventType.WAVELET_BLIP_REMOVED)) { String rootBlipId = ConversationUtil.getRootBlipId(conversation); WaveletBlipRemovedEvent event = new WaveletBlipRemovedEvent( null, null, deltaAuthor.getAddress(), deltaTimestamp, rootBlipId, blip.getId()); addEvent(event, capabilities, rootBlipId, messages); } }
public void testGenerateWaveletBlipRemovedEvent() throws Exception { ObservableConversationThread rootThread = conversationUtil.buildConversation(wavelet).getRoot().getRootThread(); ObservableConversationBlip newBlip = rootThread.appendBlip(); newBlip.delete(); EventMessageBundle messages = generateAndCheckEvents(EventType.WAVELET_BLIP_REMOVED); assertEquals("Expected two events", 2, messages.getEvents().size()); // Blip removed should be the second event. WaveletBlipRemovedEvent event = WaveletBlipRemovedEvent.as(messages.getEvents().get(1)); assertEquals("Expected the same id as the removed blip", newBlip.getId(), event.getRemovedBlipId()); }
break; case WAVELET_BLIP_REMOVED: onWaveletBlipRemoved(WaveletBlipRemovedEvent.as(event)); break; case WAVELET_CREATED:
public void testGenerateWaveletBlipRemovedEvent() throws Exception { ObservableConversationThread rootThread = conversationUtil.buildConversation(wavelet).getRoot().getRootThread(); ObservableConversationBlip newBlip = rootThread.appendBlip(); newBlip.delete(); EventMessageBundle messages = generateAndCheckEvents(EventType.WAVELET_BLIP_REMOVED); assertEquals("Expected two events", 2, messages.getEvents().size()); // Blip removed should be the second event. WaveletBlipRemovedEvent event = WaveletBlipRemovedEvent.as(messages.getEvents().get(1)); assertEquals("Expected the same id as the removed blip", newBlip.getId(), event.getRemovedBlipId()); }