### Question:
SnapshotGenerator { public void validateSnapshots() { scanner.collectResources().stream().map(this::convertToJsonNode).forEach(this::verifyAutoGeneratedClasses); } SnapshotGenerator(BeanFactory beanFactory);  SnapshotGenerator(BeanFactory beanFactory, FixtureScanner scanner); boolean createOrUpdateFixture(Object actual, boolean regenerateFixture); JsonNode getSnapshotFixtureNode(); String getCurrentSnapshotFixtureName(); void validateSnapshots();  }### Answer:
@Test public void shouldFailWhenInvalidAutoGeneratedClassDetected() { List<Resource> mockResources = createMockResources(); mockResources.add(new ClassPathResource("invalid-fixture.json")); when(scanner.collectResources()).thenReturn(mockResources); expectedException.expectMessage("ie.corballis.fixtures.snapshot.NoSuchClass does not exist anymore in "); expectedException.expectMessage("invalid-fixture.json' file. " + "If the file has been renamed/removed, " + "please update the value of _AUTO_GENERATED_FOR_ property " + "and move the file to the correct location"); snapshotGenerator.validateSnapshots(); }
@Test public void shouldNotFailWhenValidAutoGeneratedClassDetected() { List<Resource> mockResources = createMockResources(); mockResources.add(new ClassPathResource("valid-auto-generated-fixture.json")); when(scanner.collectResources()).thenReturn(mockResources); snapshotGenerator.validateSnapshots(); }
@Test public void shouldNotCareWithNonAutoGeneratedFixtures() { List<Resource> mockResources = createMockResources(); when(scanner.collectResources()).thenReturn(mockResources); snapshotGenerator.validateSnapshots(); }