@Test public void shouldRetrieveArtifactMetaDataForGivenTag() { when(fileStoreJpaRepository.findByTagAndTenantId(TAG, TENANT_ID)).thenReturn(getListOfArtifactEntities()); List<FileInfo> actual = artifactRepository.findByTag(TAG, TENANT_ID); assertEquals(actual.get(0).getContentType(), "contentType1"); assertEquals(actual.get(0).getTenantId(), TENANT_ID); assertEquals(actual.get(0).getFileLocation().getFileStoreId(), FILE_STORE_ID_1); assertEquals(actual.get(1).getContentType(), "contentType2"); assertEquals(actual.get(1).getTenantId(), TENANT_ID); assertEquals(actual.get(1).getFileLocation().getFileStoreId(), FILE_STORE_ID_2); verify(fileStoreJpaRepository).findByTagAndTenantId(TAG, TENANT_ID); }
public List<FileInfo> findByTag(String tag, String tenantId) { return fileStoreJpaRepository.findByTagAndTenantId(tag, tenantId).stream().map(this::mapArtifactToFileInfo) .collect(Collectors.toList()); }
ArtifactRepository { public List<FileInfo> findByTag(String tag, String tenantId) { return fileStoreJpaRepository.findByTagAndTenantId(tag, tenantId).stream().map(this::mapArtifactToFileInfo) .collect(Collectors.toList()); } }
ArtifactRepository { public List<FileInfo> findByTag(String tag, String tenantId) { return fileStoreJpaRepository.findByTagAndTenantId(tag, tenantId).stream().map(this::mapArtifactToFileInfo) .collect(Collectors.toList()); } ArtifactRepository(DiskFileStoreRepository diskFileStoreRepository,
			FileStoreJpaRepository fileStoreJpaRepository); }
ArtifactRepository { public List<FileInfo> findByTag(String tag, String tenantId) { return fileStoreJpaRepository.findByTagAndTenantId(tag, tenantId).stream().map(this::mapArtifactToFileInfo) .collect(Collectors.toList()); } ArtifactRepository(DiskFileStoreRepository diskFileStoreRepository,
			FileStoreJpaRepository fileStoreJpaRepository); List<String> save(List<org.egov.filestore.domain.model.Artifact> artifacts); Resource find(String fileStoreId, String tenantId); List<FileInfo> findByTag(String tag, String tenantId); List<Artifact> getByTenantIdAndFileStoreIdList(String tenantId, List<String> fileStoreIds); }
ArtifactRepository { public List<FileInfo> findByTag(String tag, String tenantId) { return fileStoreJpaRepository.findByTagAndTenantId(tag, tenantId).stream().map(this::mapArtifactToFileInfo) .collect(Collectors.toList()); } ArtifactRepository(DiskFileStoreRepository diskFileStoreRepository,
			FileStoreJpaRepository fileStoreJpaRepository); List<String> save(List<org.egov.filestore.domain.model.Artifact> artifacts); Resource find(String fileStoreId, String tenantId); List<FileInfo> findByTag(String tag, String tenantId); List<Artifact> getByTenantIdAndFileStoreIdList(String tenantId, List<String> fileStoreIds);  }