@Test
public void testBeforeEachInvocationArguments() throws Exception {

    // GIVEN
    when(DecoratorRegistrar.getMethodDecorators()).thenReturn(Arrays.asList(firstMethodDecorator));
    final JpaUnit unit = new JpaUnit();
    // WHEN
    unit.beforeEach(context);
    // THEN
    final ArgumentCaptor<TestInvocation> invocationCaptor = ArgumentCaptor.forClass(TestInvocation.class);
    verify(firstMethodDecorator).beforeTest(invocationCaptor.capture());
    final TestInvocation invocation = invocationCaptor.getValue();
    assertNotNull(invocation.getContext());
    assertThat(invocation.getTestMethod().get(), equalTo(getClass().getMethod("prepareMocks")));
    assertThat(invocation.getTestClass(), equalTo(getClass()));
    assertFalse(invocation.getException().isPresent());
    assertThat(invocation.getFeatureResolver().shouldCleanupAfter(), equalTo(Boolean.TRUE));
    assertThat(invocation.getTestInstance(), notNullValue());
}