@@ -212,10 +212,10 @@ class RoutingTest {
212
212
routing.call(
213
213
name = " named" ,
214
214
parameters =
215
- parametersOf(
216
- " id" to listOf (" 123" ),
217
- " name" to listOf (" routing" ),
218
- ),
215
+ parametersOf(
216
+ " id" to listOf (" 123" ),
217
+ " name" to listOf (" routing" ),
218
+ ),
219
219
)
220
220
advanceTimeBy(99 )
221
221
@@ -343,7 +343,7 @@ class RoutingTest {
343
343
handle {
344
344
call.redirectToName(
345
345
name = " path2" ,
346
- parameters = parametersOf(" key" , " value" )
346
+ parameters = parametersOf(" key" , " value" ),
347
347
)
348
348
}
349
349
}
@@ -379,10 +379,10 @@ class RoutingTest {
379
379
call.redirectToName(
380
380
name = " path2" ,
381
381
parameters =
382
- parametersOf(
383
- " id" to listOf (" 123" ),
384
- " key" to listOf (" value" ),
385
- ),
382
+ parametersOf(
383
+ " id" to listOf (" 123" ),
384
+ " key" to listOf (" value" ),
385
+ ),
386
386
)
387
387
}
388
388
}
@@ -1585,12 +1585,13 @@ class RoutingTest {
1585
1585
@Test
1586
1586
fun shouldReturnsTrueWhenCanHandleByANamedRoute () {
1587
1587
// GIVEN
1588
- val routing = routing {
1589
- route(path = " /path" , name = " path" ) {
1590
- handle {
1588
+ val routing =
1589
+ routing {
1590
+ route(path = " /path" , name = " path" ) {
1591
+ handle {
1592
+ }
1591
1593
}
1592
1594
}
1593
- }
1594
1595
1595
1596
// WHEN
1596
1597
val result = routing.canHandleByName(name = " path" )
@@ -1620,12 +1621,13 @@ class RoutingTest {
1620
1621
@Test
1621
1622
fun shouldReturnsTrueWhenCanHandleByANamedRouteOnParent () {
1622
1623
// GIVEN
1623
- val parent = routing {
1624
- route(path = " /path" , name = " path" ) {
1625
- handle {
1624
+ val parent =
1625
+ routing {
1626
+ route(path = " /path" , name = " path" ) {
1627
+ handle {
1628
+ }
1626
1629
}
1627
1630
}
1628
- }
1629
1631
val routing = routing(parent = parent, rootPath = " /child" ) {}
1630
1632
1631
1633
// WHEN
@@ -1638,12 +1640,13 @@ class RoutingTest {
1638
1640
@Test
1639
1641
fun shouldReturnsFalseWhenCanNotHandleByANamedRouteOnParent () {
1640
1642
// GIVEN
1641
- val parent = routing {
1642
- route(path = " /path" ) {
1643
- handle {
1643
+ val parent =
1644
+ routing {
1645
+ route(path = " /path" ) {
1646
+ handle {
1647
+ }
1644
1648
}
1645
1649
}
1646
- }
1647
1650
val routing = routing(parent = parent, rootPath = " /child" ) {}
1648
1651
1649
1652
// WHEN
@@ -1656,12 +1659,13 @@ class RoutingTest {
1656
1659
@Test
1657
1660
fun shouldReturnsTrueWhenCanHandleByAPath () {
1658
1661
// GIVEN
1659
- val routing = routing {
1660
- route(path = " /path" ) {
1661
- handle {
1662
+ val routing =
1663
+ routing {
1664
+ route(path = " /path" ) {
1665
+ handle {
1666
+ }
1662
1667
}
1663
1668
}
1664
- }
1665
1669
1666
1670
// WHEN
1667
1671
val result = routing.canHandleByPath(path = " /path" )
@@ -1673,12 +1677,13 @@ class RoutingTest {
1673
1677
@Test
1674
1678
fun shouldReturnsFalseWhenCanNotHandleByAPath () {
1675
1679
// GIVEN
1676
- val routing = routing {
1677
- route(path = " /other" ) {
1678
- handle {
1680
+ val routing =
1681
+ routing {
1682
+ route(path = " /other" ) {
1683
+ handle {
1684
+ }
1679
1685
}
1680
1686
}
1681
- }
1682
1687
1683
1688
// WHEN
1684
1689
val result = routing.canHandleByPath(path = " /path" )
@@ -1690,17 +1695,17 @@ class RoutingTest {
1690
1695
@Test
1691
1696
fun shouldReturnsTrueWhenCanHandleByAPathWithMultiLevel () {
1692
1697
// GIVEN
1693
- val routing = routing {
1694
- route(path = " /level1" ) {
1695
- route(path = " /level2" ) {
1696
- route(path = " /level3" ) {
1697
- handle {
1698
-
1698
+ val routing =
1699
+ routing {
1700
+ route(path = " /level1" ) {
1701
+ route(path = " /level2" ) {
1702
+ route(path = " /level3" ) {
1703
+ handle {
1704
+ }
1699
1705
}
1700
1706
}
1701
1707
}
1702
1708
}
1703
- }
1704
1709
1705
1710
// WHEN
1706
1711
val result = routing.canHandleByPath(path = " /level1/level2/level3" )
@@ -1712,13 +1717,13 @@ class RoutingTest {
1712
1717
@Test
1713
1718
fun shouldReturnsFalseWhenCanNotHandleByAPathWithMultiLevel () {
1714
1719
// GIVEN
1715
- val routing = routing {
1716
- route(path = " /level1" ) {
1717
- handle {
1718
-
1720
+ val routing =
1721
+ routing {
1722
+ route(path = " /level1" ) {
1723
+ handle {
1724
+ }
1719
1725
}
1720
1726
}
1721
- }
1722
1727
1723
1728
// WHEN
1724
1729
val result = routing.canHandleByPath(path = " /level1/level2/level3" )
@@ -1730,12 +1735,13 @@ class RoutingTest {
1730
1735
@Test
1731
1736
fun shouldReturnsTrueWhenCanHandleByAPathOnParent () {
1732
1737
// GIVEN
1733
- val parent = routing {
1734
- route(path = " /path" ) {
1735
- handle {
1738
+ val parent =
1739
+ routing {
1740
+ route(path = " /path" ) {
1741
+ handle {
1742
+ }
1736
1743
}
1737
1744
}
1738
- }
1739
1745
val routing = routing(parent = parent, rootPath = " /child" ) {}
1740
1746
1741
1747
// WHEN
@@ -1748,12 +1754,13 @@ class RoutingTest {
1748
1754
@Test
1749
1755
fun shouldReturnsFalseWhenCanNotHandleByAPathOnParent () {
1750
1756
// GIVEN
1751
- val parent = routing {
1752
- route(path = " /path" ) {
1753
- handle {
1757
+ val parent =
1758
+ routing {
1759
+ route(path = " /path" ) {
1760
+ handle {
1761
+ }
1754
1762
}
1755
1763
}
1756
- }
1757
1764
val routing = routing(parent = parent, rootPath = " /child" ) {}
1758
1765
1759
1766
// WHEN
@@ -1766,17 +1773,17 @@ class RoutingTest {
1766
1773
@Test
1767
1774
fun shouldReturnsTrueWhenCanHandleByAPathWithMultiLevelOnParent () {
1768
1775
// GIVEN
1769
- val parent = routing {
1770
- route(path = " /level1" ) {
1771
- route(path = " /level2" ) {
1772
- route(path = " /level3" ) {
1773
- handle {
1774
-
1776
+ val parent =
1777
+ routing {
1778
+ route(path = " /level1" ) {
1779
+ route(path = " /level2" ) {
1780
+ route(path = " /level3" ) {
1781
+ handle {
1782
+ }
1775
1783
}
1776
1784
}
1777
1785
}
1778
1786
}
1779
- }
1780
1787
val routing = routing(parent = parent, rootPath = " /child" ) {}
1781
1788
1782
1789
// WHEN
@@ -1789,13 +1796,13 @@ class RoutingTest {
1789
1796
@Test
1790
1797
fun shouldReturnsFalseWhenCanNotHandleByAPathWithMultiLevelOnParent () {
1791
1798
// GIVEN
1792
- val routing = routing {
1793
- route(path = " /level1" ) {
1794
- handle {
1795
-
1799
+ val routing =
1800
+ routing {
1801
+ route(path = " /level1" ) {
1802
+ handle {
1803
+ }
1796
1804
}
1797
1805
}
1798
- }
1799
1806
1800
1807
// WHEN
1801
1808
val result = routing.canHandleByPath(path = " /level1/level2/level3" , lookUpOnParent = true )
@@ -1807,24 +1814,27 @@ class RoutingTest {
1807
1814
@Test
1808
1815
fun shouldReturnsTrueWhenCanHandleByAPathInNestedRouting () {
1809
1816
// GIVEN
1810
- val parent = routing {
1811
- route(path = " /parent" ) {
1812
- handle {
1817
+ val parent =
1818
+ routing {
1819
+ route(path = " /parent" ) {
1820
+ handle {
1821
+ }
1813
1822
}
1814
1823
}
1815
- }
1816
- val child = routing(parent = parent, rootPath = " /child" ) {
1817
- route(path = " /childPath" ) {
1818
- handle {
1824
+ val child =
1825
+ routing(parent = parent, rootPath = " /child" ) {
1826
+ route(path = " /childPath" ) {
1827
+ handle {
1828
+ }
1819
1829
}
1820
1830
}
1821
- }
1822
- val grandchild = routing(parent = child, rootPath = " /grandchild" ) {
1823
- route(path = " /grandchildPath" ) {
1824
- handle {
1831
+ val grandchild =
1832
+ routing(parent = child, rootPath = " /grandchild" ) {
1833
+ route(path = " /grandchildPath" ) {
1834
+ handle {
1835
+ }
1825
1836
}
1826
1837
}
1827
- }
1828
1838
1829
1839
// WHEN
1830
1840
val result = grandchild.canHandleByPath(path = " /child/childPath" , lookUpOnParent = true )
@@ -1836,24 +1846,27 @@ class RoutingTest {
1836
1846
@Test
1837
1847
fun shouldReturnsFalseWhenCanNotHandleByAPathInNestedRouting () {
1838
1848
// GIVEN
1839
- val parent = routing {
1840
- route(path = " /parent" ) {
1841
- handle {
1849
+ val parent =
1850
+ routing {
1851
+ route(path = " /parent" ) {
1852
+ handle {
1853
+ }
1842
1854
}
1843
1855
}
1844
- }
1845
- val child = routing(parent = parent, rootPath = " /child" ) {
1846
- route(path = " /childPath" ) {
1847
- handle {
1856
+ val child =
1857
+ routing(parent = parent, rootPath = " /child" ) {
1858
+ route(path = " /childPath" ) {
1859
+ handle {
1860
+ }
1848
1861
}
1849
1862
}
1850
- }
1851
- val grandchild = routing(parent = child, rootPath = " /grandchild" ) {
1852
- route(path = " /grandchildPath" ) {
1853
- handle {
1863
+ val grandchild =
1864
+ routing(parent = child, rootPath = " /grandchild" ) {
1865
+ route(path = " /grandchildPath" ) {
1866
+ handle {
1867
+ }
1854
1868
}
1855
1869
}
1856
- }
1857
1870
1858
1871
// WHEN
1859
1872
val result =
0 commit comments