Package com.streamreduce.core.model.messages.details.feed

Examples of com.streamreduce.core.model.messages.details.feed.FeedEntryDetails


    public void testRefreshFeedMessagesIncludesFeedEntryDetails() throws Exception {
        final List<FeedEntryDetails> feedEntryDetailList = Lists.newArrayList();
        doAnswer(new Answer() {
            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable {
                FeedEntryDetails feedEntryDetails = (FeedEntryDetails) invocation.getArguments()[3];
                feedEntryDetailList.add(feedEntryDetails);
                return null;
            }
        }).when(mockMessageService).sendActivityMessage(any(Event.class),
                any(Connection.class),
                anyLong(),
                any(SobaMessageDetails.class));

        inventoryService.eventService = mock(EventService.class);

        ReflectionTestUtils.setField(inventoryService, "messageService", mockMessageService);

        inventoryService.pullInventoryItemActivity(sampleFeedConnection);

        assertEquals(2, feedEntryDetailList.size());

        FeedEntryDetails degradedPerformanceDetails = feedEntryDetailList.get(0);
        assertEquals("Informational message: Investigating degraded performance of EBS volumes", degradedPerformanceDetails.getTitle());
        assertEquals("http://status.aws.amazon.com/#EC2_1330560778", degradedPerformanceDetails.getUrl());

        SimpleDateFormat sdf = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz");
        assertEquals(sdf.parse("Wed, 29 Feb 2012 16:12:58 PST"), degradedPerformanceDetails.getPublishedDate());
        assertTrue(degradedPerformanceDetails.getDescription().startsWith("We are investigating"));
    }
View Full Code Here


                Event event = eventService.createEvent(EventId.ACTIVITY,
                        connection,
                        eventContext);

                FeedEntryDetails details = new FeedEntryDetails.Builder()
                        .url(entry.getUri())
                        .title(entry.getTitle())
                        .description(entry.getDescription() != null ? entry.getDescription().getValue() : null)
                        .publishedDate(pubDate)
                        .build();
View Full Code Here

TOP

Related Classes of com.streamreduce.core.model.messages.details.feed.FeedEntryDetails

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.