when(repository.getAttributesHandler()).thenReturn(Mockito.mock(AttributesHandler.class));
// we return some URL, but does not matter which, this is only to avoid NPE
// so execution path is "normal success" of storeItem in this case
final File baseUrl = new File("target");
when(repository.getLocalUrl()).thenReturn(baseUrl.toURI().toURL().toString());
final LocalStorageContext localStorageContext = new DefaultLocalStorageContext(null);
when(repository.getLocalStorageContext()).thenReturn(localStorageContext);
final PreparedContentLocator pcl = new PreparedContentLocator(preparedStream, "text/plain", ContentLocator.UNKNOWN_LENGTH);
final DefaultStorageFileItem file =