Search in sources :

Example 1 with ControllerMethod1

use of ninja.ControllerMethods.ControllerMethod1 in project ninja by ninjaframework.

the class LambdasTest method anonymousClassReference.

@Test
public void anonymousClassReference() throws Exception {
    @SuppressWarnings("Convert2Lambda") ControllerMethod1<Context> lambda = new ControllerMethod1<Context>() {

        @Override
        public Result apply(Context a) {
            return Results.html().renderRaw("".getBytes(StandardCharsets.UTF_8));
        }
    };
    try {
        LambdaInfo lambdaInfo = Lambdas.reflect(lambda);
        fail();
    } catch (IllegalArgumentException e) {
    // expected
    }
}
Also used : ControllerMethod1(ninja.ControllerMethods.ControllerMethod1) Context(ninja.Context) LambdaInfo(ninja.utils.Lambdas.LambdaInfo) Test(org.junit.Test)

Aggregations

Context (ninja.Context)1 ControllerMethod1 (ninja.ControllerMethods.ControllerMethod1)1 LambdaInfo (ninja.utils.Lambdas.LambdaInfo)1 Test (org.junit.Test)1