Search in sources :

Example 6 with MethodReference

use of ninja.utils.MethodReference in project ninja by ninjaframework.

the class RouterImplTest method getReverseRouteWithMethodReference.

@Test
public void getReverseRouteWithMethodReference() {
    String contextPath = "";
    when(ninjaProperties.getContextPath()).thenReturn(contextPath);
    String route = router.getReverseRoute(TestController.class, "ref");
    String route2 = router.getReverseRoute(new MethodReference(TestController.class, "ref"));
    assertThat(route, is("/ref"));
    assertThat(route2, is("/ref"));
}
Also used : MethodReference(ninja.utils.MethodReference) Test(org.junit.Test)

Aggregations

MethodReference (ninja.utils.MethodReference)6 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)1 ControllerMethod0 (ninja.ControllerMethods.ControllerMethod0)1 ParamParsers (ninja.params.ParamParsers)1 NinjaBaseDirectoryResolver (ninja.utils.NinjaBaseDirectoryResolver)1 Before (org.junit.Before)1