Skip to content

Commit 714166b

Browse files
committed
SeriesInfoExtractorServiceImpl.extractSellerUrl(): add unit test.
Fix #864
1 parent c37b93b commit 714166b

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/main/java/ru/mystamps/web/service/SeriesInfoExtractorServiceImpl.java

-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,6 @@ protected String extractSellerName(Integer id, String name) {
351351
return name;
352352
}
353353

354-
// @todo #695 SeriesInfoExtractorServiceImpl.extractSellerUrl(): add unit tests
355354
protected String extractSellerUrl(Integer id, String url) {
356355
if (id != null) {
357356
return null;

src/test/groovy/ru/mystamps/web/service/SeriesInfoExtractorServiceImplTest.groovy

+15
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,21 @@ class SeriesInfoExtractorServiceImplTest extends Specification {
445445
null | 'Seller Name' || 'Seller Name'
446446
}
447447

448+
//
449+
// Tests for extractSellerUrl()
450+
//
451+
452+
@Unroll
453+
@SuppressWarnings('UnnecessaryBooleanExpression') // false positive
454+
def 'extractSellerUrl() should return "#expected" for id=#id/url=#url'(Integer id, String url, String expected) {
455+
expect:
456+
service.extractSellerUrl(id, url) == expected
457+
where:
458+
id | url || expected
459+
Random.id() | Random.url() || null
460+
null | 'http://example.com' || 'http://example.com'
461+
}
462+
448463
//
449464
// Tests for extractPrice()
450465
//

0 commit comments

Comments
 (0)