diff --git a/src/main/java/com/redfin/sitemapgenerator/AbstractSitemapGeneratorOptions.java b/src/main/java/com/redfin/sitemapgenerator/AbstractSitemapGeneratorOptions.java index ccbd1d0..502fa98 100644 --- a/src/main/java/com/redfin/sitemapgenerator/AbstractSitemapGeneratorOptions.java +++ b/src/main/java/com/redfin/sitemapgenerator/AbstractSitemapGeneratorOptions.java @@ -10,6 +10,7 @@ abstract class AbstractSitemapGeneratorOptions files = wsg.write(); + assertEquals("Sitemap has a suffix now", "sitemap01.xml", files.get(0).getName()); + } + + public void testNullSuffixPassed() throws MalformedURLException { + wsg = WebSitemapGenerator.builder("http://www.example.com", dir).suffixStringPattern("").build(); + wsg.addUrl("http://www.example.com/url1"); + wsg.addUrl("http://www.example.com/url2"); + List files = wsg.write(); + assertEquals("Sitemap has a suffix now", "sitemap.xml", files.get(0).getName()); + } + public void testTooManyUrls() throws Exception { wsg = WebSitemapGenerator.builder("http://www.example.com", dir).allowMultipleSitemaps(false).build(); for (int i = 0; i < SitemapGenerator.MAX_URLS_PER_SITEMAP; i++) {