Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when I was trying to develop unit test. #19

Open
douglasalipio opened this issue Jan 21, 2018 · 0 comments
Open

Error when I was trying to develop unit test. #19

douglasalipio opened this issue Jan 21, 2018 · 0 comments

Comments

@douglasalipio
Copy link

Hey,

I was testing my application and I got the error:

java.lang.NullPointerException
	at com.einmalfel.earl.EarlParser.parseOrThrow(EarlParser.java:46)
	at org.secfirst.umbrella.RSSFeedParserTest.getInformationAboutChannelInXmlV1(RSSFeedParserTest.java:74)

I believe that occurs ever you try to mock your RSS like this: src/test/resources/bbc_rss.xml.

@Test
    public void getInformationAboutChannelInXmlV1() throws IOException, XmlPullParserException, DataFormatException {
        InputStream inputStream = getClass().getClassLoader()
                .getResourceAsStream("rss_parse/" + "rss_bbc.xml");
        Feed feed = EarlParser.parseOrThrow(inputStream, 0);
        assertEquals(feed.getTitle(), "BBC News - Business");
        assertEquals(feed.getDescription(), "BBC News - Business");
        assertEquals(feed.getImageLink(), "http://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif");
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant