use of org.apache.sling.testing.mock.sling.servlet.MockRequestPathInfo in project aem-core-cif-components by adobe.
the class ProductPageWithSkuCategoryAndUrlKeyTest method testParse.
@Test
public void testParse() {
MockRequestPathInfo pathInfo = new MockRequestPathInfo();
pathInfo.setResourcePath("/page/path");
pathInfo.setSuffix("/foo-bar/category/next-generation-foo-bar2021.html");
ProductUrlFormat.Params parameters = subject.parse(pathInfo, null);
assertEquals("/page/path", parameters.getPage());
assertEquals("foo-bar", parameters.getSku());
assertEquals("next-generation-foo-bar2021", parameters.getUrlKey());
assertEquals("category", parameters.getCategoryUrlParams().getUrlKey());
}
use of org.apache.sling.testing.mock.sling.servlet.MockRequestPathInfo in project aem-core-cif-components by adobe.
the class ProductPageWithSkuCategoryAndUrlKeyTest method testParseSuffixNoSlash.
@Test
public void testParseSuffixNoSlash() {
MockRequestPathInfo pathInfo = new MockRequestPathInfo();
pathInfo.setResourcePath("/page/path");
pathInfo.setSuffix("/foo-bar.html");
ProductUrlFormat.Params parameters = subject.parse(pathInfo, null);
assertEquals("/page/path", parameters.getPage());
assertEquals("foo-bar", parameters.getSku());
assertNull(parameters.getUrlKey());
assertNull(parameters.getCategoryUrlParams().getUrlKey());
}
use of org.apache.sling.testing.mock.sling.servlet.MockRequestPathInfo in project aem-core-cif-components by adobe.
the class ProductPageWithSkuTest method testParse.
@Test
public void testParse() {
MockRequestPathInfo pathInfo = new MockRequestPathInfo();
pathInfo.setResourcePath("/page/path");
pathInfo.setSuffix("/foo-bar.html");
ProductUrlFormat.Params parameters = subject.parse(pathInfo, null);
assertEquals("/page/path", parameters.getPage());
assertEquals("foo-bar", parameters.getSku());
}
use of org.apache.sling.testing.mock.sling.servlet.MockRequestPathInfo in project aem-core-cif-components by adobe.
the class ProductPageWithSkuTest method testParseNoSuffix.
@Test
public void testParseNoSuffix() {
MockRequestPathInfo pathInfo = new MockRequestPathInfo();
pathInfo.setResourcePath("/page/path");
ProductUrlFormat.Params parameters = subject.parse(pathInfo, null);
assertEquals("/page/path", parameters.getPage());
assertNull(parameters.getSku());
}
use of org.apache.sling.testing.mock.sling.servlet.MockRequestPathInfo in project aem-core-cif-components by adobe.
the class ProductPageWithUrlKeyTest method testParseNoSuffix.
@Test
public void testParseNoSuffix() {
MockRequestPathInfo pathInfo = new MockRequestPathInfo();
pathInfo.setResourcePath("/page/path");
ProductUrlFormat.Params parameters = subject.parse(pathInfo, null);
assertEquals("/page/path", parameters.getPage());
assertNull(parameters.getUrlKey());
}
Aggregations