// create Repository Mock
Repository repository = mock(Repository.class);
when(repository.getId()).thenReturn("mock");
when(repository.getRepositoryKind()).thenReturn(new DefaultRepositoryKind(HostedRepository.class, null));
when(repository.getLocalUrl()).thenReturn(repoLocation.toURI().toURL().toString());
AttributesHandler attributesHandler = mock(AttributesHandler.class);
when(repository.getAttributesHandler()).thenReturn(attributesHandler);
when(repository.getLocalStorageContext()).thenReturn(new DefaultLocalStorageContext(null));
RepositoryItemUid uid = mock(RepositoryItemUid.class);
when(repository.createUid(anyString())).thenReturn(uid);