MessageMethodEndpointAdapter extends AbstractMethodEndpointAdapter { @Override protected boolean supportsInternal(MethodEndpoint methodEndpoint) { Method method = methodEndpoint.getMethod(); return Void.TYPE.isAssignableFrom(method.getReturnType()) && method.getParameterTypes().length == 1 && MessageContext.class.isAssignableFrom(method.getParameterTypes()[0]); }    }
@Test public void testSupported() throws NoSuchMethodException { MethodEndpoint methodEndpoint = new MethodEndpoint(this, "supported", new Class[] { MessageContext.class }); Assert.assertTrue("Method unsupported", adapter.supportsInternal(methodEndpoint)); }
@Test public void testUnsupportedMethodMultipleParams() throws NoSuchMethodException { Assert.assertFalse("Method supported", adapter.supportsInternal(new MethodEndpoint(this, "unsupportedMultipleParams", new Class[] { MessageContext.class, MessageContext.class }))); }
@Test public void testUnsupportedMethodWrongParam() throws NoSuchMethodException { Assert.assertFalse("Method supported", adapter.supportsInternal(new MethodEndpoint(this, "unsupportedWrongParam", new Class[] { String.class }))); }