use google java formatter to avoid downloading eclipse during build

This commit is contained in:
Athou
2026-07-05 10:18:30 +02:00
parent f4dc279ec9
commit 1bd9b71215
200 changed files with 13923 additions and 12754 deletions

View File

@@ -1,18 +1,18 @@
package com.commafeed.backend.urlprovider;
import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
class InPageReferenceFeedURLProviderTest {
private final InPageReferenceFeedURLProvider provider = new InPageReferenceFeedURLProvider();
private final InPageReferenceFeedURLProvider provider = new InPageReferenceFeedURLProvider();
@Test
void extractUrls() {
String url = "http://example.com";
String html = """
@Test
void extractUrls() {
String url = "http://example.com";
String html =
"""
<html>
<head>
<link type="application/atom+xml" href="/feed.atom">
@@ -22,24 +22,28 @@ class InPageReferenceFeedURLProviderTest {
</body>
</html>""";
Assertions.assertIterableEquals(List.of("http://example.com/feed.atom", "http://example.com/feed.rss"), provider.get(url, html));
}
Assertions.assertIterableEquals(
List.of("http://example.com/feed.atom", "http://example.com/feed.rss"),
provider.get(url, html));
}
@Test
void returnsEmptyListForNonHtmlContent() {
String url = "http://example.com";
String html = """
@Test
void returnsEmptyListForNonHtmlContent() {
String url = "http://example.com";
String html =
"""
<?xml version="1.0"?>
<feed></feed>
</xml>""";
Assertions.assertTrue(provider.get(url, html).isEmpty());
}
Assertions.assertTrue(provider.get(url, html).isEmpty());
}
@Test
void returnsEmptyListForHtmlWithoutFeedLinks() {
String url = "http://example.com";
String html = """
@Test
void returnsEmptyListForHtmlWithoutFeedLinks() {
String url = "http://example.com";
String html =
"""
<html>
<head>
<link type="text/css" href="/style.css">
@@ -48,6 +52,6 @@ class InPageReferenceFeedURLProviderTest {
</body>
</html>""";
Assertions.assertTrue(provider.get(url, html).isEmpty());
}
}
Assertions.assertTrue(provider.get(url, html).isEmpty());
}
}

View File

@@ -1,24 +1,24 @@
package com.commafeed.backend.urlprovider;
import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
class YoutubeFeedURLProviderTest {
private final YoutubeFeedURLProvider provider = new YoutubeFeedURLProvider();
private final YoutubeFeedURLProvider provider = new YoutubeFeedURLProvider();
@Test
void matchesYoutubeChannelURL() {
Assertions.assertIterableEquals(List.of("https://www.youtube.com/feeds/videos.xml?channel_id=abc"),
provider.get("https://www.youtube.com/channel/abc", null));
}
@Test
void matchesYoutubeChannelURL() {
Assertions.assertIterableEquals(
List.of("https://www.youtube.com/feeds/videos.xml?channel_id=abc"),
provider.get("https://www.youtube.com/channel/abc", null));
}
@Test
void doesNotmatchYoutubeChannelURL() {
Assertions.assertTrue(provider.get("https://www.anothersite.com/channel/abc", null).isEmpty());
Assertions.assertTrue(provider.get("https://www.youtube.com/user/abc", null).isEmpty());
}
}
@Test
void doesNotmatchYoutubeChannelURL() {
Assertions.assertTrue(
provider.get("https://www.anothersite.com/channel/abc", null).isEmpty());
Assertions.assertTrue(provider.get("https://www.youtube.com/user/abc", null).isEmpty());
}
}