use of com.tvd12.ezyhttp.server.core.reflect.RequestHandlerMethod in project ezyhttp by youngmonkeys.
the class RequestHandlerImplementerTest method test.
@Test
public void test() {
RequestHandlerImplementer.setDebug(true);
ControllerProxy homeController = new ControllerProxy(new HomeController());
for (RequestHandlerMethod method : homeController.getRequestHandlerMethods()) {
RequestHandlerImplementer implementer = new RequestHandlerImplementer(homeController, method);
implementer.implement();
}
}
use of com.tvd12.ezyhttp.server.core.reflect.RequestHandlerMethod in project ezyhttp by youngmonkeys.
the class RequestHandlerMethodTest method test.
@Test
public void test() throws Exception {
// given
RequestHandlerMethod sut = new RequestHandlerMethod("/get", new EzyMethod(InternalController.class.getDeclaredMethod("getSomething")));
// when
// then
Asserts.assertFalse(sut.isPayment());
Asserts.assertNull(sut.getFeature());
System.out.println(sut);
}
use of com.tvd12.ezyhttp.server.core.reflect.RequestHandlerMethod in project ezyhttp by youngmonkeys.
the class RequestHandlerImplementerTest method implementOneFailed.
@Test
public void implementOneFailed() throws Exception {
// given
ControllerProxy controller = new ControllerProxy(new Controller());
RequestHandlerMethod handlerMethod = new RequestHandlerMethod("/", new EzyMethod(Controller.class.getDeclaredMethod("doGet")));
RequestHandlerImplementer sut = new RequestHandlerImplementer(controller, handlerMethod);
// when
Throwable e = Asserts.assertThrows(sut::implement);
// then
Asserts.assertEquals(0, handlerMethod.getParameterTypes().length);
Asserts.assertThat(e).isEqualsType(IllegalStateException.class);
}
use of com.tvd12.ezyhttp.server.core.reflect.RequestHandlerMethod in project ezyhttp by youngmonkeys.
the class RequestHandlerImplementerTest method test.
@Test
public void test() {
RequestHandlerImplementer.setDebug(true);
ControllerProxy homeController = new ControllerProxy(new HomeController());
for (RequestHandlerMethod method : homeController.getRequestHandlerMethods()) {
RequestHandlerImplementer implementer = new RequestHandlerImplementer(homeController, method);
implementer.implement();
}
}
use of com.tvd12.ezyhttp.server.core.reflect.RequestHandlerMethod in project ezyhttp by youngmonkeys.
the class RequestHandlerImplementerTest method test.
@Test
public void test() {
RequestHandlerImplementer.setDebug(true);
ControllerProxy homeController = new ControllerProxy(new HomeController());
for (RequestHandlerMethod method : homeController.getRequestHandlerMethods()) {
RequestHandlerImplementer implementer = new RequestHandlerImplementer(homeController, method);
implementer.implement();
}
}
Aggregations