<commit_before>package br.com.caelum.vraptor4.interceptor;

import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.spy;

import org.junit.Ignore;
import org.junit.Test;

import br.com.caelum.vraptor4.AroundCall;
import br.com.caelum.vraptor4.BeforeCall;
import br.com.caelum.vraptor4.InterceptionException;
import br.com.caelum.vraptor4.interceptor.example.ExampleOfSimpleStackInterceptor;
import br.com.caelum.vraptor4.interceptor.example.InterceptorWithInheritance;
import br.com.caelum.vraptor4.interceptor.example.WeldProxy$$$StyleInterceptor;

public class StepInvokerTest {

	private StepInvoker stepInvoker = new StepInvoker();

	@Ignore
	public void shouldNotReadInheritedMethods() throws Exception {
		stepInvoker.findMethod(AroundCall.class,InterceptorWithInheritance.class);
	}

	@Test
	public void shouldFindFirstMethodAnnotatedWithInterceptorStep(){
		ExampleOfSimpleStackInterceptor proxy = spy(new ExampleOfSimpleStackInterceptor());
		assertNotNull(stepInvoker.findMethod(AroundCall.class, proxy.getClass()));
	}

	@Test
	public void shouldFindMethodFromWeldStyleInterceptor() throws SecurityException, NoSuchMethodException{
		assertNotNull(stepInvoker.findMethod(AroundCall.class, WeldProxy$$$StyleInterceptor.class));
	}

	@Test(expected=InterceptionException.class)
	public void shouldWrapMirrorException() throws SecurityException, NoSuchMethodException {
		assertNotNull(stepInvoker.findMethod(BeforeCall.class, ExceptionThrowerInterceptor.class));
		stepInvoker.tryToInvoke(new ExceptionThrowerInterceptor(), BeforeCall.class);
	}

}
<commit_msg>merging issue33ThrowMirrorException<commit_after>package br.com.caelum.vraptor4.interceptor;

import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.spy;

import org.junit.Ignore;
import org.junit.Test;

import br.com.caelum.vraptor4.AroundCall;
import br.com.caelum.vraptor4.BeforeCall;
import br.com.caelum.vraptor4.InterceptionException;
import br.com.caelum.vraptor4.interceptor.example.ExampleOfSimpleStackInterceptor;
import br.com.caelum.vraptor4.interceptor.example.InterceptorWithInheritance;
import br.com.caelum.vraptor4.interceptor.example.WeldProxy$$$StyleInterceptor;

public class StepInvokerTest {

	private StepInvoker stepInvoker = new StepInvoker();

	@Ignore
	public void shouldNotReadInheritedMethods() throws Exception {
		stepInvoker.findMethod(AroundCall.class,InterceptorWithInheritance.class);
	}

	@Test
	public void shouldFindFirstMethodAnnotatedWithInterceptorStep(){
		ExampleOfSimpleStackInterceptor proxy = spy(new ExampleOfSimpleStackInterceptor());
		assertNotNull(stepInvoker.findMethod(AroundCall.class, proxy.getClass()));
	}

	@Test
	public void shouldFindMethodFromWeldStyleInterceptor() throws SecurityException, NoSuchMethodException{
		assertNotNull(stepInvoker.findMethod(AroundCall.class, WeldProxy$$$StyleInterceptor.class));
	}

	@Test(expected=InterceptionException.class)
	public void shouldWrapMirrorException() throws SecurityException, NoSuchMethodException {
		assertNotNull(stepInvoker.findMethod(BeforeCall.class, ExceptionThrowerInterceptor.class));
		stepInvoker.tryToInvoke(new ExceptionThrowerInterceptor(), BeforeCall.class);
	}
}

{'fraction_non_alphanumeric': 0.09099407915238392, 'fraction_numerical': 0.004985976939856653, 'mean_word_length': 8.197707736389685, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2374366', 'n_tokens_mistral': 1012, 'n_tokens_neox': 989, 'n_words': 141}