@Test public void testGetComponentById_NoResultsIsNull() { String expectedSql = format("SELECT FROM %s WHERE contentAuth(@this.name, @this.format, :browsedRepository) == true", componentOneORID); when(storageTx.browse(eq(expectedSql), paramsCaptor.capture())).thenReturn(Collections.emptyList()); assertThat(underTest.getComponentById(componentOneORID, mavenReleases), nullValue()); Map<String, Object> params = paramsCaptor.getValue(); assertThat(params.get("browsedRepository"), is("releases")); }
@Override public Component getComponentById(final ORID componentId, final Repository repository) { checkNotNull(repository); checkNotNull(componentId); return getById(componentId, repository, componentEntityAdapter); }
BrowseServiceImpl extends ComponentSupport implements BrowseService { @Override public Component getComponentById(final ORID componentId, final Repository repository) { checkNotNull(repository); checkNotNull(componentId); return getById(componentId, repository, componentEntityAdapter); } }
BrowseServiceImpl extends ComponentSupport implements BrowseService { @Override public Component getComponentById(final ORID componentId, final Repository repository) { checkNotNull(repository); checkNotNull(componentId); return getById(componentId, repository, componentEntityAdapter); } @Inject  BrowseServiceImpl(@Named(GroupType.NAME) final Type groupType,
                           final ComponentEntityAdapter componentEntityAdapter,
                           final VariableResolverAdapterManager variableResolverAdapterManager,
                           final ContentPermissionChecker contentPermissionChecker,
                           final AssetEntityAdapter assetEntityAdapter,
                           final BrowseAssetIterableFactory browseAssetIterableFactory,
                           final BrowseAssetsSqlBuilder browseAssetsSqlBuilder,
                           final BrowseComponentsSqlBuilder browseComponentsSqlBuilder,
                           final BucketStore bucketStore,
                           final RepositoryManager repositoryManager); }
BrowseServiceImpl extends ComponentSupport implements BrowseService { @Override public Component getComponentById(final ORID componentId, final Repository repository) { checkNotNull(repository); checkNotNull(componentId); return getById(componentId, repository, componentEntityAdapter); } @Inject  BrowseServiceImpl(@Named(GroupType.NAME) final Type groupType,
                           final ComponentEntityAdapter componentEntityAdapter,
                           final VariableResolverAdapterManager variableResolverAdapterManager,
                           final ContentPermissionChecker contentPermissionChecker,
                           final AssetEntityAdapter assetEntityAdapter,
                           final BrowseAssetIterableFactory browseAssetIterableFactory,
                           final BrowseAssetsSqlBuilder browseAssetsSqlBuilder,
                           final BrowseComponentsSqlBuilder browseComponentsSqlBuilder,
                           final BucketStore bucketStore,
                           final RepositoryManager repositoryManager); @Override PageResult<Component> browseComponents(final Repository repository,
                                                  final QueryOptions queryOptions); @Override PageResult<Asset> browseComponentAssets(final Repository repository, final String componentId); @Override PageResult<Asset> browseComponentAssets(final Repository repository, final Component component); @Override PageResult<Asset> browseAssets(final Repository repository,
                                          final QueryOptions queryOptions); @Override PageResult<Asset> previewAssets(final RepositorySelector repositorySelector,
                                           final List<Repository> repositories,
                                           final String jexlExpression,
                                           final QueryOptions queryOptions); @Override Asset getAssetById(final ORID assetId, final Repository repository); @Override Component getComponentById(final ORID componentId, final Repository repository); @Override Map<EntityId, String> getRepositoryBucketNames(final Repository repository); @Override Asset getAssetById(final EntityId assetId, final Repository repository); }
BrowseServiceImpl extends ComponentSupport implements BrowseService { @Override public Component getComponentById(final ORID componentId, final Repository repository) { checkNotNull(repository); checkNotNull(componentId); return getById(componentId, repository, componentEntityAdapter); } @Inject  BrowseServiceImpl(@Named(GroupType.NAME) final Type groupType,
                           final ComponentEntityAdapter componentEntityAdapter,
                           final VariableResolverAdapterManager variableResolverAdapterManager,
                           final ContentPermissionChecker contentPermissionChecker,
                           final AssetEntityAdapter assetEntityAdapter,
                           final BrowseAssetIterableFactory browseAssetIterableFactory,
                           final BrowseAssetsSqlBuilder browseAssetsSqlBuilder,
                           final BrowseComponentsSqlBuilder browseComponentsSqlBuilder,
                           final BucketStore bucketStore,
                           final RepositoryManager repositoryManager); @Override PageResult<Component> browseComponents(final Repository repository,
                                                  final QueryOptions queryOptions); @Override PageResult<Asset> browseComponentAssets(final Repository repository, final String componentId); @Override PageResult<Asset> browseComponentAssets(final Repository repository, final Component component); @Override PageResult<Asset> browseAssets(final Repository repository,
                                          final QueryOptions queryOptions); @Override PageResult<Asset> previewAssets(final RepositorySelector repositorySelector,
                                           final List<Repository> repositories,
                                           final String jexlExpression,
                                           final QueryOptions queryOptions); @Override Asset getAssetById(final ORID assetId, final Repository repository); @Override Component getComponentById(final ORID componentId, final Repository repository); @Override Map<EntityId, String> getRepositoryBucketNames(final Repository repository); @Override Asset getAssetById(final EntityId assetId, final Repository repository);  }