@Test
public void repositoryFileReferenceWithSubdirectoryCorrectlyCreated() {

    ArtifactTemplateId artifactTemplateId = new ArtifactTemplateId("http://www.example.org", "at", false);
    ArtifactTemplateSourceDirectoryId artifactTemplateSourceDirectoryId = new ArtifactTemplateSourceDirectoryId(artifactTemplateId);
    final Path subDirectories = Paths.get("d1", "d2");
    final RepositoryFileReference repositoryFileReference = BackendUtils.getRepositoryFileReference(Paths.get("main"), Paths.get("main", "d1", "d2", "file.txt"), artifactTemplateSourceDirectoryId);
    assertEquals(artifactTemplateSourceDirectoryId, repositoryFileReference.getParent());
    assertEquals(Optional.of(subDirectories), repositoryFileReference.getSubDirectory());
    assertEquals("file.txt", repositoryFileReference.getFileName());
}