Remove mockito pre-null-safety tests.

Now that all source code in google3 has been migrated to use Dart language
version 2.12 or greater, this test case isn't needed anymore. Removing it helps
unblock the removal of legacy (pre-null-safety) support from the Dart analyzer.

PiperOrigin-RevId: 590334278
diff --git a/test/builder/auto_mocks_test.dart b/test/builder/auto_mocks_test.dart
index 5840c9a..2b7f6bb 100644
--- a/test/builder/auto_mocks_test.dart
+++ b/test/builder/auto_mocks_test.dart
@@ -79,19 +79,6 @@
 void main() {
   late InMemoryAssetWriter writer;
 
-  /// Test [MockBuilder] in a package which has not opted into null safety.
-  Future<void> testPreNonNullable(Map<String, String> sourceAssets,
-      {Map<String, /*String|Matcher<String>*/ Object>? outputs,
-      Map<String, dynamic> config = const <String, dynamic>{}}) async {
-    final packageConfig = PackageConfig([
-      Package('foo', Uri.file('/foo/'),
-          packageUriRoot: Uri.file('/foo/lib/'),
-          languageVersion: LanguageVersion(2, 7))
-    ]);
-    await testBuilder(buildMocks(BuilderOptions(config)), sourceAssets,
-        writer: writer, outputs: outputs, packageConfig: packageConfig);
-  }
-
   /// Test [MockBuilder] in a package which has opted into null safety.
   Future<void> testWithNonNullable(Map<String, String> sourceAssets,
       {Map<String, /*String|Matcher<List<int>>*/ Object>? outputs,
@@ -3375,65 +3362,6 @@
     );
   });
 
-  test('given a pre-non-nullable library, includes an opt-out comment',
-      () async {
-    await testPreNonNullable(
-      {
-        ...annotationsAsset,
-        ...simpleTestAsset,
-        'foo|lib/foo.dart': dedent(r'''
-        abstract class Foo {
-          int f(int a);
-        }
-        '''),
-      },
-      outputs: {'foo|test/foo_test.mocks.dart': _containsAllOf('// @dart=2.9')},
-    );
-  });
-
-  test('given a pre-non-nullable library, does not override any members',
-      () async {
-    await testPreNonNullable(
-      {
-        ...annotationsAsset,
-        ...simpleTestAsset,
-        'foo|lib/foo.dart': dedent(r'''
-        abstract class Foo {
-          int f(int a);
-        }
-        '''),
-      },
-      outputs: {
-        'foo|test/foo_test.mocks.dart': _containsAllOf(dedent('''
-        class MockFoo extends _i1.Mock implements _i2.Foo {
-          MockFoo() {
-            _i1.throwOnMissingStub(this);
-          }
-        }
-        '''))
-      },
-    );
-  });
-
-  test('given a pre-non-nullable library, overrides toString if necessary',
-      () async {
-    await testPreNonNullable(
-      {
-        ...annotationsAsset,
-        ...simpleTestAsset,
-        'foo|lib/foo.dart': dedent(r'''
-        abstract class Foo {
-          String toString({bool a = false});
-        }
-        '''),
-      },
-      outputs: {
-        'foo|test/foo_test.mocks.dart': _containsAllOf(
-            'String toString({bool a = false}) => super.toString();')
-      },
-    );
-  });
-
   test(
       'adds ignore: must_be_immutable analyzer comment if mocked class is '
       'immutable', () async {
diff --git a/test/builder/custom_mocks_test.dart b/test/builder/custom_mocks_test.dart
index e725f48..b03ce4c 100644
--- a/test/builder/custom_mocks_test.dart
+++ b/test/builder/custom_mocks_test.dart
@@ -89,18 +89,6 @@
 void main() {
   late InMemoryAssetWriter writer;
 
-  /// Test [MockBuilder] in a package which has not opted into null safety.
-  Future<void> testPreNonNullable(Map<String, String> sourceAssets,
-      {Map<String, /*String|Matcher<String>*/ Object>? outputs}) async {
-    final packageConfig = PackageConfig([
-      Package('foo', Uri.file('/foo/'),
-          packageUriRoot: Uri.file('/foo/lib/'),
-          languageVersion: LanguageVersion(2, 7))
-    ]);
-    await testBuilder(buildMocks(BuilderOptions({})), sourceAssets,
-        outputs: outputs, packageConfig: packageConfig);
-  }
-
   /// Builds with [MockBuilder] in a package which has opted into null safety,
   /// returning the content of the generated mocks library.
   Future<String> buildWithNonNullable(Map<String, String> sourceAssets) async {
@@ -624,34 +612,6 @@
 
   test(
       'generates mock methods with non-nullable return types, specifying '
-      'legal default values for basic known types, in mixed mode', () async {
-    final mocksContent = await buildWithNonNullable({
-      ...annotationsAsset,
-      'foo|lib/foo.dart': dedent(r'''
-        abstract class Foo {
-          int m({required int x, double? y});
-        }
-        '''),
-      'foo|test/foo_test.dart': '''
-        // @dart=2.9
-        import 'package:foo/foo.dart';
-        import 'package:mockito/annotations.dart';
-
-        @GenerateMocks(
-          [],
-          customMocks: [
-            MockSpec<Foo>(onMissingStub: OnMissingStub.returnDefault),
-          ],
-        )
-        void main() {}
-        '''
-    });
-    expect(mocksContent, contains('returnValue: 0,'));
-    expect(mocksContent, contains('returnValueForMissingStub: 0,'));
-  });
-
-  test(
-      'generates mock methods with non-nullable return types, specifying '
       'legal default values for unknown types', () async {
     final mocksContent = await buildWithNonNullable({
       ...annotationsAsset,
@@ -1273,58 +1233,6 @@
     );
   });
 
-  test('given a pre-non-nullable library, does not override any members',
-      () async {
-    await testPreNonNullable(
-      {
-        ...annotationsAsset,
-        ...simpleTestAsset,
-        'foo|lib/foo.dart': dedent(r'''
-        abstract class Foo {
-          int f(int a);
-        }
-        '''),
-      },
-      outputs: {
-        'foo|test/foo_test.mocks.dart': _containsAllOf(dedent('''
-        class MockFoo extends _i1.Mock implements _i2.Foo {
-          $_constructorWithThrowOnMissingStub
-        }
-        '''))
-      },
-    );
-  });
-
-  test(
-      'given a pre-non-nullable safe library, does not write "?" on interface '
-      'types', () async {
-    await testPreNonNullable(
-      {
-        ...annotationsAsset,
-        ...simpleTestAsset,
-        'foo|lib/foo.dart': dedent('''
-        abstract class Foo<T> {
-          int f(int a);
-        }
-        '''),
-        'foo|test/foo_test.dart': dedent('''
-        import 'package:foo/foo.dart';
-        import 'package:mockito/annotations.dart';
-        @GenerateMocks(
-            [], customMocks: [MockSpec<Foo<int>>(as: #MockFoo)])
-        void main() {}
-        '''),
-      },
-      outputs: {
-        'foo|test/foo_test.mocks.dart': _containsAllOf(dedent('''
-        class MockFoo extends _i1.Mock implements _i2.Foo<int> {
-          $_constructorWithThrowOnMissingStub
-        }
-        '''))
-      },
-    );
-  });
-
   test(
       'generates a mock class which uses the new behavior of returning '
       'a valid value for missing stubs, if GenerateNiceMocks were used',