diff --git a/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestAppCrawler.scala b/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestAppCrawler.scala index 33b15a5b..05110a96 100644 --- a/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestAppCrawler.scala +++ b/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestAppCrawler.scala @@ -35,8 +35,8 @@ class TestAppCrawler { def testCrawlApp(): Unit = { def app = new RouteNode(null) { setRoute(Route.empty() - .and(RouteUtils.get("/", r => new Page1)) - .and(RouteUtils.get("/page2", r => new Page2))) + .and(RouteUtils.getView("/", r => new Page1)) + .and(RouteUtils.getView("/page2", r => new Page2))) } val result = AppCrawler.crawlApp("http://localhost", () => app) @@ -50,7 +50,7 @@ class TestAppCrawler { def testEmptyImage(): Unit = { def app = new RouteNode(null) { setRoute(Route.empty() - .and(RouteUtils.get("/", r => new View { + .and(RouteUtils.getView("/", r => new View { override def title: String = "" override def description: String = "" diff --git a/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestMemoryTester.scala b/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestMemoryTester.scala index 626e17ea..9c9c1bd0 100644 --- a/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestMemoryTester.scala +++ b/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestMemoryTester.scala @@ -14,9 +14,9 @@ class TestMemoryTester { def simpleTest(): Unit = { def app = new RouteNode(null) { setRoute(Route.empty() - .and(get("/", r => new Page1)) - .and(get("/page2", r => new Page2)) - .and(get("/page4", r => new Page2))) + .and(getView("/", r => new Page1)) + .and(getView("/page2", r => new Page2)) + .and(getView("/page4", r => new Page2))) } val result = AppCrawler.crawlApp("http://localhost", () => app) MemoryTester.testForLeaks(result, () => app) @@ -27,9 +27,9 @@ class TestMemoryTester { val page2 = new Page2 def app = new RouteNode(null) { setRoute(Route.empty() - .and(get("/", r => new Page1)) - .and(get("/page2", r => page2)) - .and(get("/page4", r => new Page2))) + .and(getView("/", r => new Page1)) + .and(getView("/page2", r => page2)) + .and(getView("/page4", r => new Page2))) } val result = AppCrawler.crawlApp("http://localhost", () => app) intercept[Throwable](MemoryTester.testForLeaks(result, () => app)) @@ -41,9 +41,9 @@ class TestMemoryTester { def app = new RouteNode(null) { setRoute(Route.empty() - .and(get("/", r => new Page1)) - .and(get("/page2", r => viewFromNode(node2))) - .and(get("/page4", r => new Page2))) + .and(getView("/", r => new Page1)) + .and(getView("/page2", r => viewFromNode(node2))) + .and(getView("/page4", r => new Page2))) } val result = AppCrawler.crawlApp("http://localhost", () => app) @@ -54,9 +54,9 @@ class TestMemoryTester { def simpleFailingTest3(): Unit = { val app = inFX(new RouteNode(null) { setRoute(Route.empty() - .and(get("/", r => new Page1)) - .and(get("/page2", r => new Page2)) - .and(get("/page4", r => new Page2))) + .and(getView("/", r => new Page1)) + .and(getView("/page2", r => new Page2)) + .and(getView("/page4", r => new Page2))) }) val result = AppCrawler.crawlApp("http://localhost", () => app) intercept[Throwable](MemoryTester.testForLeaks(result, () => app)) // fails because the webapp is not collectable diff --git a/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestSitemapGenerator.scala b/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestSitemapGenerator.scala index ee65b458..5a24b60e 100644 --- a/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestSitemapGenerator.scala +++ b/jpro-routing/core-test/src/test/scala/one/jpro/platform/routing/crawl/TestSitemapGenerator.scala @@ -2,7 +2,7 @@ package one.jpro.platform.routing.crawl import one.jpro.platform.routing.RouteUtils._ import one.jpro.platform.routing.crawl.TestUtils._ -import one.jpro.platform.routing.{Redirect, Route, RouteNode} +import one.jpro.platform.routing.{Redirect, Response, Route, RouteNode} import org.junit.jupiter.api.Test import simplefx.experimental._ @@ -11,10 +11,10 @@ class TestSitemapGenerator { def test(): Unit = { def app = new RouteNode(null) { setRoute(Route.empty() - .and(get("/", r => new Page1)) - .and(get("/page2", r => new Page2)) - .and(get("/page4", r => new Page2)) - .and(r => FXFuture.unit(new Page1))) + .and(getView("/", r => new Page1)) + .and(getView("/page2", r => new Page2)) + .and(getView("/page4", r => new Page2)) + .and(r => Response.view(new Page1))) } val result = AppCrawler.crawlApp("http://localhost", () => app) val sm = SitemapGenerator.createSitemap("http://localhost", result) @@ -28,8 +28,8 @@ class TestSitemapGenerator { def testMailToRedirect(): Unit = { def app = new RouteNode(null) { setRoute(Route.empty() - .and(get("/", r => pageWithLink(List("/page2", "/page3", "mailto:something")))) - .and(get("/page2", r => new Redirect("mailto:something-2")))) + .and(getView("/", r => pageWithLink(List("/page2", "/page3", "mailto:something")))) + .and(get("/page2", r => Response.redirect("mailto:something-2")))) } val result = AppCrawler.crawlApp("http://localhost", () => app) println("got result: " + result)