use of org.apache.sling.testing.mock.sling.servlet.MockRequestPathInfo in project aem-core-cif-components by adobe.
the class CategoryPageWithUrlPathTest method testParse.
@Test
public void testParse() {
MockRequestPathInfo pathInfo = new MockRequestPathInfo();
pathInfo.setResourcePath("/page/path");
pathInfo.setSuffix("/foo-bar/foobar.html");
CategoryUrlFormat.Params parameters = subject.parse(pathInfo, null);
assertEquals("/page/path", parameters.getPage());
assertEquals("foobar", parameters.getUrlKey());
assertEquals("foo-bar/foobar", parameters.getUrlPath());
}
use of org.apache.sling.testing.mock.sling.servlet.MockRequestPathInfo in project aem-core-cif-components by adobe.
the class CategoryPageWithUrlPathTest method testParseNoSuffix.
@Test
public void testParseNoSuffix() {
MockRequestPathInfo pathInfo = new MockRequestPathInfo();
pathInfo.setResourcePath("/page/path");
CategoryUrlFormat.Params parameters = subject.parse(pathInfo, null);
assertEquals("/page/path", parameters.getPage());
assertNull(parameters.getUrlPath());
}
use of org.apache.sling.testing.mock.sling.servlet.MockRequestPathInfo in project aem-core-cif-components by adobe.
the class ProductPageWithCategoryAndUrlKeyTest method testParse.
@Test
public void testParse() {
MockRequestPathInfo pathInfo = new MockRequestPathInfo();
pathInfo.setResourcePath("/page/path");
pathInfo.setSuffix("/category/foo-bar.html");
ProductUrlFormat.Params parameters = subject.parse(pathInfo, null);
assertEquals("/page/path", parameters.getPage());
assertEquals("foo-bar", 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 ProductPageWithCategoryAndUrlKeyTest 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());
assertNull(parameters.getCategoryUrlParams().getUrlKey());
}
use of org.apache.sling.testing.mock.sling.servlet.MockRequestPathInfo in project aem-core-cif-components by adobe.
the class ProductPageWithSkuAndUrlKeyTest 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());
assertNull(parameters.getUrlKey());
}
Aggregations