@Test
public void testValidateProjectValidator() throws Exception {

  final Project project = mock(Project.class);
  final File projectDir = mock(File.class);
  final Props props = new Props();
  final ProjectValidator mockValidator = mock(ProjectValidator.class);
  final XmlValidatorManager manager = new XmlValidatorManager(props);
  // When we attempt to validate a project with our mock validator, return sampleReport
  final ValidationReport sampleReport = new ValidationReport();
  when(mockValidator.validateProject(project, projectDir, props)).thenReturn(sampleReport);
  Map<String, ProjectValidator> mockedValidators = new HashMap();
  mockedValidators.put("TEST", mockValidator);
  // This is brittle and hacky, but we're directly setting the private validators field with our own
  Field validatorsField = manager.getClass().getDeclaredField("validators");
  validatorsField.setAccessible(true);
  FieldSetter.setField(manager, validatorsField, mockedValidators);
  Map<String, ValidationReport> expectedResultingReports = new HashMap();
  expectedResultingReports.put("TEST", sampleReport);
  // Make sure we get the reports back that we expect
  assertEquals(expectedResultingReports, manager.validate(project, projectDir, props));
}