@Test
  public void createAndLoadRepositoryEntry() {
    Identity initialAuthor = JunitTestHelper.createAndPersistIdentityAsRndUser("auth-1");

    String displayName = "Service test 2";
    String resourceName = "ServiceTest";
    String description = "Test the brand new service";
    RepositoryEntry re =
        repositoryService.create(
            initialAuthor, null, resourceName, displayName, description, null, 0);
    dbInstance.commitAndCloseSession();
    Assert.assertNotNull(re);

    RepositoryEntry loadedEntry = repositoryService.loadByKey(re.getKey());
    Assert.assertNotNull(loadedEntry);
    Assert.assertNotNull(re.getCreationDate());
    Assert.assertNotNull(re.getLastModified());
    Assert.assertNotNull(re.getOlatResource());
    Assert.assertNotNull(loadedEntry.getGroups());
    Assert.assertEquals(1, loadedEntry.getGroups().size());
    // saved?
    Assert.assertEquals(displayName, re.getDisplayname());
    Assert.assertEquals(resourceName, re.getResourcename());
    Assert.assertEquals(description, re.getDescription());
    // default value
    Assert.assertFalse(re.getCanCopy());
    Assert.assertFalse(re.getCanDownload());
    Assert.assertFalse(re.getCanReference());
    Assert.assertEquals(0, re.getAccess());
  }
  @Test
  public void createRepositoryEntry() {
    Identity initialAuthor = JunitTestHelper.createAndPersistIdentityAsRndUser("auth-1");

    String displayName = "ServiceTest";
    String resourceName = "ServiceTest";
    String description = "Test the brand new service";
    RepositoryEntry re =
        repositoryService.create(
            initialAuthor, null, resourceName, displayName, description, null, 0);
    dbInstance.commit();

    Assert.assertNotNull(re);
    Assert.assertNotNull(re.getCreationDate());
    Assert.assertNotNull(re.getLastModified());
    Assert.assertNotNull(re.getOlatResource());
  }