@Test public void testGet() { String name = "img-name"; ImageCatalog imageCatalog = new ImageCatalog(); when(imageCatalogRepository.findByNameAndWorkspaceId(name, ORG_ID)).thenReturn(Optional.of(imageCatalog)); ImageCatalog actual = underTest.get(ORG_ID, name); assertEquals(actual, imageCatalog); }
public ImageCatalog get(NameOrCrn imageCatalogNameOrCrn, Long workspaceId) { return imageCatalogNameOrCrn.hasName() ? get(workspaceId, imageCatalogNameOrCrn.getName()) : findByResourceCrn(imageCatalogNameOrCrn.getCrn()); }
ImageCatalogService extends AbstractWorkspaceAwareResourceService<ImageCatalog> implements ResourceBasedCrnProvider { public ImageCatalog get(NameOrCrn imageCatalogNameOrCrn, Long workspaceId) { return imageCatalogNameOrCrn.hasName() ? get(workspaceId, imageCatalogNameOrCrn.getName()) : findByResourceCrn(imageCatalogNameOrCrn.getCrn()); } }
ImageCatalogService extends AbstractWorkspaceAwareResourceService<ImageCatalog> implements ResourceBasedCrnProvider { public ImageCatalog get(NameOrCrn imageCatalogNameOrCrn, Long workspaceId) { return imageCatalogNameOrCrn.hasName() ? get(workspaceId, imageCatalogNameOrCrn.getName()) : findByResourceCrn(imageCatalogNameOrCrn.getCrn()); }  }
ImageCatalogService extends AbstractWorkspaceAwareResourceService<ImageCatalog> implements ResourceBasedCrnProvider { public ImageCatalog get(NameOrCrn imageCatalogNameOrCrn, Long workspaceId) { return imageCatalogNameOrCrn.hasName() ? get(workspaceId, imageCatalogNameOrCrn.getName()) : findByResourceCrn(imageCatalogNameOrCrn.getCrn()); }  @Override Set<ImageCatalog> findAllByWorkspaceId(Long workspaceId); ImageCatalog delete(NameOrCrn imageCatalogNameOrCrn, Long workspaceId); @Override Set<ImageCatalog> findAllByWorkspace(Workspace workspace); ImageCatalog createForLoggedInUser(ImageCatalog imageCatalog, Long workspaceId, String accountId, String creator); ImageCatalog get(NameOrCrn imageCatalogNameOrCrn, Long workspaceId); ImageCatalog findByResourceCrn(String resourceCrn); Images getImagesByCatalogName(Long workspaceId, String catalogName, String stackName, String platform); Images getImagesFromDefault(Long workspaceId, String stackName, String platform, Set<String> operatingSystems); StatedImages getStatedImagesFilteredByOperatingSystems(ImageFilter imageFilter, Predicate<Image> imageFilterPredicate); StatedImage getLatestBaseImageDefaultPreferred(ImageFilter imageFilter, Predicate<Image> imageFilterPredicate); StatedImage getImagePrewarmedDefaultPreferred(ImageFilter imageFilter, Predicate<Image> imageFilterPredicate); StatedImages getImages(Long workspaceId, String name, String provider); StatedImages getImages(Long workspaceId, String name, Set<String> providers); StatedImage getImage(String imageId); StatedImage getImage(String catalogUrl, String catalogName, String imageId); StatedImage getImageByCatalogName(Long workspaceId, String imageId, String catalogName); ImageCatalog delete(Long workspaceId, String name); Set<ImageCatalog> deleteMultiple(Long workspaceId, Set<String> names); ImageCatalog get(Long workspaceId, String name); boolean isEnvDefault(String name); ImageCatalog update(Long workspaceId, ImageCatalog source); StatedImages getImages(ImageFilter imageFilter); Images propagateImagesIfRequested(Long workspaceId, String name, Boolean withImages); boolean baseImageEnabled(); @Nonnull ImageCatalog getDefaultImageCatalog(User user); String getDefaultImageCatalogName(User user); String getImageDefaultCatalogUrl(User user); @Override WorkspaceResourceRepository<ImageCatalog, Long> repository(); @Override String getResourceCrnByResourceName(String resourceName); @Override List<String> getResourceCrnListByResourceNameList(List<String> resourceNames); @Override List<String> getResourceCrnsInAccount(); List<ImageCatalog> getDefaultImageCatalogs(); @Override AuthorizationResourceType getResourceType(); }
ImageCatalogService extends AbstractWorkspaceAwareResourceService<ImageCatalog> implements ResourceBasedCrnProvider { public ImageCatalog get(NameOrCrn imageCatalogNameOrCrn, Long workspaceId) { return imageCatalogNameOrCrn.hasName() ? get(workspaceId, imageCatalogNameOrCrn.getName()) : findByResourceCrn(imageCatalogNameOrCrn.getCrn()); }  @Override Set<ImageCatalog> findAllByWorkspaceId(Long workspaceId); ImageCatalog delete(NameOrCrn imageCatalogNameOrCrn, Long workspaceId); @Override Set<ImageCatalog> findAllByWorkspace(Workspace workspace); ImageCatalog createForLoggedInUser(ImageCatalog imageCatalog, Long workspaceId, String accountId, String creator); ImageCatalog get(NameOrCrn imageCatalogNameOrCrn, Long workspaceId); ImageCatalog findByResourceCrn(String resourceCrn); Images getImagesByCatalogName(Long workspaceId, String catalogName, String stackName, String platform); Images getImagesFromDefault(Long workspaceId, String stackName, String platform, Set<String> operatingSystems); StatedImages getStatedImagesFilteredByOperatingSystems(ImageFilter imageFilter, Predicate<Image> imageFilterPredicate); StatedImage getLatestBaseImageDefaultPreferred(ImageFilter imageFilter, Predicate<Image> imageFilterPredicate); StatedImage getImagePrewarmedDefaultPreferred(ImageFilter imageFilter, Predicate<Image> imageFilterPredicate); StatedImages getImages(Long workspaceId, String name, String provider); StatedImages getImages(Long workspaceId, String name, Set<String> providers); StatedImage getImage(String imageId); StatedImage getImage(String catalogUrl, String catalogName, String imageId); StatedImage getImageByCatalogName(Long workspaceId, String imageId, String catalogName); ImageCatalog delete(Long workspaceId, String name); Set<ImageCatalog> deleteMultiple(Long workspaceId, Set<String> names); ImageCatalog get(Long workspaceId, String name); boolean isEnvDefault(String name); ImageCatalog update(Long workspaceId, ImageCatalog source); StatedImages getImages(ImageFilter imageFilter); Images propagateImagesIfRequested(Long workspaceId, String name, Boolean withImages); boolean baseImageEnabled(); @Nonnull ImageCatalog getDefaultImageCatalog(User user); String getDefaultImageCatalogName(User user); String getImageDefaultCatalogUrl(User user); @Override WorkspaceResourceRepository<ImageCatalog, Long> repository(); @Override String getResourceCrnByResourceName(String resourceName); @Override List<String> getResourceCrnListByResourceNameList(List<String> resourceNames); @Override List<String> getResourceCrnsInAccount(); List<ImageCatalog> getDefaultImageCatalogs(); @Override AuthorizationResourceType getResourceType(); static final String UNDEFINED; static final String CDP_DEFAULT_CATALOG_NAME; }