@Test
public void testGetDataFileWithTransaction() {

    final String sql = "select f from DataFile f where f.path = ?1";
    final String path = "/over/the/rainbow";
    final DataFile dataFile = createDataFile(path);
    when(persistenceManager.pick(sql, path)).thenReturn(dataFile);
    final DataFile toolStorageDatafile = jpaStorage.getDatafileWithTransaction(path);
    assertNotNull(toolStorageDatafile);
    assertEquals(path, toolStorageDatafile.getPath());
    verify(persistenceManager, times(1)).transaction();
    verify(persistenceManager, times(1)).pick(sql, path);
    verify(persistenceManager, times(1)).commit();
    verifyNoMoreInteractions(persistenceManager);
}