Skip to content

Commit 00fddaf

Browse files
committed
SiteParser.canParse(): add unit tests.
Addressed to #685 No functional changes.
1 parent 93639f5 commit 00fddaf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test/java/ru/mystamps/web/util/extractor/SiteParserTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,20 @@ public void canParseShouldRequireNonNullMatchedUrl() {
266266
parser.canParse(Random.url());
267267
}
268268

269+
@Test
270+
public void canParseWithUnsupportedUrl() {
271+
parser.setMatchedUrl("http://example.org");
272+
273+
assertThat(parser.canParse("http://example.com/test/fail"), is(false));
274+
}
275+
276+
@Test
277+
public void canParseWithSupportedUrl() {
278+
parser.setMatchedUrl("http://example.org");
279+
280+
assertThat(parser.canParse("http://example.org/test/success"), is(true));
281+
}
282+
269283
//
270284
// Tests for parse()
271285
//

0 commit comments

Comments
 (0)