@Test public void shouldNotInstantiateIfThereIsAlreadyAResource() throws InterceptionException, IOException { final DogController myDog = new DogController(); InstantiateInterceptor interceptor = new InstantiateInterceptor(null); interceptor.intercept(stack, method, myDog); verify(stack).next(method, myDog); }
public void intercept(InterceptorStack invocation, ResourceMethod method, Object instance) throws InterceptionException { if (instance == null) { Class<?> type = method.getResource().getType(); instance = container.instanceFor(type); } invocation.next(method, instance); }
InstantiateInterceptor implements Interceptor { public void intercept(InterceptorStack invocation, ResourceMethod method, Object instance) throws InterceptionException { if (instance == null) { Class<?> type = method.getResource().getType(); instance = container.instanceFor(type); } invocation.next(method, instance); } }
InstantiateInterceptor implements Interceptor { public void intercept(InterceptorStack invocation, ResourceMethod method, Object instance) throws InterceptionException { if (instance == null) { Class<?> type = method.getResource().getType(); instance = container.instanceFor(type); } invocation.next(method, instance); } InstantiateInterceptor(Container container); }
InstantiateInterceptor implements Interceptor { public void intercept(InterceptorStack invocation, ResourceMethod method, Object instance) throws InterceptionException { if (instance == null) { Class<?> type = method.getResource().getType(); instance = container.instanceFor(type); } invocation.next(method, instance); } InstantiateInterceptor(Container container); void intercept(InterceptorStack invocation, ResourceMethod method,
			Object instance); boolean accepts(ResourceMethod method); }
InstantiateInterceptor implements Interceptor { public void intercept(InterceptorStack invocation, ResourceMethod method, Object instance) throws InterceptionException { if (instance == null) { Class<?> type = method.getResource().getType(); instance = container.instanceFor(type); } invocation.next(method, instance); } InstantiateInterceptor(Container container); void intercept(InterceptorStack invocation, ResourceMethod method,
			Object instance); boolean accepts(ResourceMethod method);  }