@Test
public void testLoadTestResult() throws Exception {

	File file = new File(BASE_DIRECTORY + "/test1/testClass/result.json");
	file.getParentFile().mkdirs();
	FileUtils.copyURLToFile(getClass().getResource("FilePersister_TestResult.json"), file);
	PersistMetadata metadata = new PersistMetadata("test1", "testClass");
	TestResult actual = persister.loadTestResult(metadata);
	TestResult expected = JSONUtils.readValue(getClass().getResourceAsStream("FilePersister_TestResult.json"),
			TestResult.class);
	Field imageField = TargetResult.class.getDeclaredField("image");
	imageField.setAccessible(true);
	for (ScreenshotResult sr : expected.getScreenshotResults()) {
		ScreenshotImage image = new PersistedScreenshotImage(persister, new PersistMetadata(expected.getResultId(),
				sr.getTestClass(), sr.getTestMethod(), sr.getScreenshotId(), new IndexDomSelector(
						SelectorType.TAG_NAME, "body", 0), null, new PtlCapabilities(sr.getCapabilities())));
		imageField.set(sr.getTargetResults().get(0), image);
	}
	assertThat(actual, is(expected));
}