public void testShouldGenerateDefaultExcludeMethodInterceptorAnnotations() throws Exception {
// setup
final IJDTFacade facade = context.mock(IJDTFacade.class);
SessionBeanConverter converter = new SessionBeanConverter(facade);
// expectations
context.checking(new Expectations(){{
one(facade).addMethodAnnotation("test.TestBean", "test", new String[0], ExcludeDefaultInterceptors.class, createNameValuePair("value", new String[] { SessionBeanConverterTest.class.getCanonicalName() })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
one(facade).addMethodAnnotation("test.TestBean", "test", new String[0], Interceptors.class, createNameValuePair("value", new String[] { SessionBeanConverterTest.class.getCanonicalName() })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}});
EjbJar ejbJar = new EjbJar();
EnterpriseBean bean = addStatefulBeanToEjbJar(ejbJar, "TestBean", "test.TestBean"); //$NON-NLS-1$ //$NON-NLS-2$
Interceptor interceptor = new Interceptor(SessionBeanConverterTest.class);
ejbJar.addInterceptor(interceptor);
List<InterceptorBinding> interceptorBindings = ejbJar.getAssemblyDescriptor().getInterceptorBinding();
InterceptorBinding binding = new InterceptorBinding(bean, interceptor);
binding.setExcludeDefaultInterceptors(true);
NamedMethod method = new NamedMethod();
method.setMethodName("test"); //$NON-NLS-1$
method.setMethodParams(new MethodParams());
binding.setMethod(method);
interceptorBindings.add(binding);
// execute
converter.processInterceptors(ejbJar);
// verify
context.assertIsSatisfied();
}