Package org.axonframework.common.annotation

Examples of org.axonframework.common.annotation.ParameterResolver


    private static void testMethod(AbstractAnnotatedParameterResolverFactory<?,?> factory, Method method, Class<?>[] expectedResolvers) {
        Class<?>[] parameterTypes = method.getParameterTypes();
        Annotation[][] annotations = method.getParameterAnnotations();
        for(int param = 0; param < parameterTypes.length; param++) {
            ParameterResolver resolver = factory.createInstance(
                    new Annotation[]{}, parameterTypes[param], annotations[param]);
            assertEquals("Result incorrect for param: " + param, expectedResolvers[param], resolver != null ? resolver.getClass() : null);
        }
    }
View Full Code Here


        });
    }

    @Test
    public void testResolvesToDateTimeWhenAnnotated() throws Exception {
        ParameterResolver resolver = testSubject.createInstance(new Annotation[0],
                                                                DateTime.class,
                                                                new Annotation[]{annotation});
        final EventMessage<Object> message = GenericEventMessage.asEventMessage("test");
        assertTrue(resolver.matches(message));
        assertEquals(message.getTimestamp(), resolver.resolveParameterValue(message));
    }
View Full Code Here

        assertEquals(message.getTimestamp(), resolver.resolveParameterValue(message));
    }

    @Test
    public void testIgnoredWhenNotAnnotated() throws Exception {
        ParameterResolver resolver = testSubject.createInstance(new Annotation[0],
                                                                DateTime.class,
                                                                new Annotation[0]);
        assertNull(resolver);
    }
View Full Code Here

        assertNull(resolver);
    }

    @Test
    public void testIgnoredWhenWrongType() throws Exception {
        ParameterResolver resolver = testSubject.createInstance(new Annotation[0],
                                                                String.class,
                                                                new Annotation[]{annotation});
        assertNull(resolver);
    }
View Full Code Here

TOP

Related Classes of org.axonframework.common.annotation.ParameterResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.