Delete unit test accessing external resource
Unit tests should be reliable. Depending on external resource makes the test fragile. The module will be deprecated, so there is no point in rewriting the test.
This commit is contained in:
parent
d9d2bb9e32
commit
31eb82b386
1 changed files with 0 additions and 54 deletions
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* To change this template, choose Tools | Templates and open the template in the editor.
|
||||
*/
|
||||
package com.rometools.certiorem.hub;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.rometools.fetcher.impl.HashMapFeedInfoCache;
|
||||
import com.rometools.fetcher.impl.HttpURLFeedFetcher;
|
||||
import com.rometools.rome.feed.synd.SyndEntry;
|
||||
import com.rometools.rome.feed.synd.SyndFeed;
|
||||
|
||||
public class DeltaSyndFeedInfoTest {
|
||||
|
||||
@Test
|
||||
public void testGetSyndFeed() throws Exception {
|
||||
|
||||
final URL url = new URL("https://news.google.com/news?pz=1&cf=all&ned=us&hl=en&output=rss");
|
||||
|
||||
final DeltaFeedInfoCache feedInfoCache = new DeltaFeedInfoCache(new HashMapFeedInfoCache());
|
||||
final HttpURLFeedFetcher feedFetcher = new HttpURLFeedFetcher(feedInfoCache);
|
||||
|
||||
// the first time the feed should not be empty
|
||||
final SyndFeed firstFeed = feedFetcher.retrieveFeed(url);
|
||||
final List<SyndEntry> firstEntries = firstFeed.getEntries();
|
||||
assertFalse(firstEntries.isEmpty());
|
||||
|
||||
// fetch once again and this time the entries should be empty because nothing has changed
|
||||
final SyndFeed secondFeed = feedFetcher.retrieveFeed(url);
|
||||
final List<SyndEntry> secondEntries = secondFeed.getEntries();
|
||||
assertTrue(secondEntries.isEmpty());
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue