anchor.diff:      testWithoutContext('Continues on failed stamp file update', () async {
         final FileSystem fileSystem = MemoryFileSystem.test();
         final BufferLogger logger = BufferLogger.test();
  -      final Cache mockCache = MockCache();
         final Directory artifactDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_artifact.');
         final Directory downloadDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_download.');
  -
  -      when(mockCache.getVersionFor(any)).thenReturn('asdasd');
  -      when(mockCache.getArtifactDirectory(any)).thenReturn(artifactDir);
  -      when(mockCache.getDownloadDir()).thenReturn(downloadDir);
  -      when(mockCache.setStampFor(any, any)).thenAnswer((_) {
  -        throw const FileSystemException('stamp write failed');
  -      });
  -      final FakeSimpleArtifact artifact = FakeSimpleArtifact(mockCache);
  +      final Cache cache = FakeSecondaryCache()
  +        ..version = 'asdasd'
  +        ..artifactDirectory = artifactDir
  +        ..downloadDir = downloadDir
  +        ..onSetStamp = (String name, String version) {
  +          throw const FileSystemException('stamp write failed');
  +        };
  +
  +      final FakeSimpleArtifact artifact = FakeSimpleArtifact(cache);
         await artifact.update(FakeArtifactUpdater(), logger, fileSystem, FakeOperatingSystemUtils());
   
         expect(logger.errorText, contains('stamp write failed'));
  
positive.code:   @override
    String stampName = 'ios-usb';
  }
  class MockCache extends Mock implements Cache {}
  
  class FakeVersionedPackageResolver extends Fake implements VersionedPackageResolver {
    final List<List<String>> resolved = <List<String>>[];
  
negative.code:     testWithoutContext('Continues on missing version file', () async {
        final FileSystem fileSystem = MemoryFileSystem.test();
        final BufferLogger logger = BufferLogger.test();
        final Directory artifactDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_artifact.');
        final Directory downloadDir = fileSystem.systemTempDirectory.createTempSync('flutter_cache_test_download.');
        final Cache cache = FakeSecondaryCache()
          ..version = null // version is missing.
          ..artifactDirectory = artifactDir
          ..downloadDir = downloadDir;
  
        final FakeSimpleArtifact artifact = FakeSimpleArtifact(cache);
        await artifact.update(FakeArtifactUpdater(), logger, fileSystem, FakeOperatingSystemUtils());
  
        expect(logger.errorText, contains('No known version for the artifact name "fake"'));
  