@Test public void testEnumCamel() throws NoSuchMethodException, SecurityException { Call call = routing.find("enum/fooBar", Verb.GET); assertEquals(call.getMethod(), MethodParameter.class.getMethod("enumTest", TestEnum.class)); TestEnum e = (TestEnum) call.execute(); assertEquals(e, TestEnum.FOO_BAR); }
@Test public void testLong() throws NoSuchMethodException, SecurityException { Call call = routing.find("long/100998", Verb.GET); assertEquals(call.getMethod(), MethodParameter.class.getMethod("longSchlong", Long.TYPE)); long l1 = (Long) call.execute(); assertEquals(l1, 100998); }
@Test public void testSingleInt() throws NoSuchMethodException, SecurityException { Call call = routing.find("integer/100", Verb.GET); assertEquals(call.getMethod(), MethodParameter.class.getMethod("integer", Integer.TYPE)); Integer i1 = (Integer) call.execute(); assertEquals((int) i1, 100); }
@Test(expectedExceptions = NoMatchException.class) public void testSingleIntToHigh() throws NoSuchMethodException, SecurityException { routing.find("integer/10001", Verb.GET); }
@BeforeMethod public void setUp() { routing = new Router(); routing.register(MethodParameter.class); }