package name.falgout.jeffrey.testing.junit5;

import static com.google.common.truth.Truth.assertThat;
import static org.junit.jupiter.api.Assertions.assertAll;
import static org.mockito.Mockito.verify;

import java.util.ArrayList;
import java.util.function.Function;
import java.util.function.Supplier;
import name.falgout.jeffrey.testing.junit5.ExpectFailure.Cause;
import name.falgout.jeffrey.testing.junit5.TestPlanExecutionReport.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.ParameterResolutionException;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.Spy;

@ExtendWith(MockitoExtension.class)
public class MockitoExtensionTest {
  @Mock Function<String, String> mock;
  @Spy ArrayList<String> spy;
  @Captor ArgumentCaptor<String> captor;

  @Test
  void mocksAreInitialized() {
    assertThat(mock).isNotNull();
  }

  @Test
  void spiesAreInitialized() {
    assertThat(spy).isNotNull();
  }

  @Test
  void captorsAreInitialized() {
    assertThat(captor).isNotNull();
  }

  @Test
  void canCreateMocksForTests(@Mock Supplier<String> supplier) {
    assertThat(supplier).isNotNull();
  }

  @Test
  void canCreateCaptors(ArgumentCaptor<String> captor) {
    assertThat(captor).isNotNull();

    mock.apply("foo");

    verify(mock).apply(captor.capture());
    assertThat(captor.getAllValues()).containsExactly("foo");
  }

  @SuppressWarnings("unused")
  @Nested
  class NegativeExamples {
    @ExpectFailure(
        @Cause(type = ParameterResolutionException.class, message = "Too many factories")
    )
    @Test
    void tooManyFactories(@Mock ArgumentCaptor<String> whoShouldWin) {}

    @ExpectFailure(
        @Cause(type = ParameterResolutionException.class, message = "No ParameterResolver")
    )
    @Test
    void notAnnotated(Supplier<String> notAnnotatedWithMock) {}
  }
}

@@ -99,66 +99,8 @@
 at;%0A
-import static org.junit.jupiter.api.Assertions.assertAll;%0A
 impo
@@ -137,16 +137,16 @@
 verify;%0A
+
 %0Aimport 
@@ -162,24 +162,47 @@
 .ArrayList;%0A
+import java.util.List;%0A
 import java.
@@ -261,16 +261,16 @@
 pplier;%0A
+
 import n
@@ -329,88 +329,8 @@
 se;%0A
-import name.falgout.jeffrey.testing.junit5.TestPlanExecutionReport.DisplayName;%0A
 impo
@@ -1400,16 +1400,151 @@
 );%0A  %7D%0A%0A
+  @Test%0A  void mocksAreDifferent(@Mock List%3CString%3E list1, @Mock List%3CString%3E list2) %7B%0A    assertThat(list1).isNotEqualTo(list2);%0A  %7D%0A%0A
   @Suppr

Add a test to ensure mocked parameters are different.