@Test(expected = NotFoundException.class) public void testGetAssetById_notFound() { RepositoryItemIDXO repositoryItemIDXO = new RepositoryItemIDXO("maven-releases", "f10bd0593de3b5e4b377049bcaa80d3e"); when(assetEntityAdapter.recordIdentity(new DetachedEntityId(repositoryItemIDXO.getId()))).thenReturn(assetOneORID); when(browseService.getAssetById(assetOneORID, mavenReleases)).thenReturn(null); underTest.getAssetById(repositoryItemIDXO.getValue()); }
@GET @Path("/{id}") public AssetXO getAssetById(@PathParam("id") final String id) { RepositoryItemIDXO repositoryItemIDXO = fromString(id); Repository repository = repositoryManagerRESTAdapter.getRepository(repositoryItemIDXO.getRepositoryId()); Asset asset = getAsset(id, repository, new DetachedEntityId(repositoryItemIDXO.getId())); return fromAsset(asset, repository); }
AssetsResource extends ComponentSupport implements Resource, AssetsResourceDoc { @GET @Path("/{id}") public AssetXO getAssetById(@PathParam("id") final String id) { RepositoryItemIDXO repositoryItemIDXO = fromString(id); Repository repository = repositoryManagerRESTAdapter.getRepository(repositoryItemIDXO.getRepositoryId()); Asset asset = getAsset(id, repository, new DetachedEntityId(repositoryItemIDXO.getId())); return fromAsset(asset, repository); } }
AssetsResource extends ComponentSupport implements Resource, AssetsResourceDoc { @GET @Path("/{id}") public AssetXO getAssetById(@PathParam("id") final String id) { RepositoryItemIDXO repositoryItemIDXO = fromString(id); Repository repository = repositoryManagerRESTAdapter.getRepository(repositoryItemIDXO.getRepositoryId()); Asset asset = getAsset(id, repository, new DetachedEntityId(repositoryItemIDXO.getId())); return fromAsset(asset, repository); } @Inject  AssetsResource(final BrowseService browseService,
                        final RepositoryManagerRESTAdapter repositoryManagerRESTAdapter,
                        final AssetEntityAdapter assetEntityAdapter,
                        final MaintenanceService maintenanceService,
                        @Named("asset") final ContinuationTokenHelper continuationTokenHelper); }
AssetsResource extends ComponentSupport implements Resource, AssetsResourceDoc { @GET @Path("/{id}") public AssetXO getAssetById(@PathParam("id") final String id) { RepositoryItemIDXO repositoryItemIDXO = fromString(id); Repository repository = repositoryManagerRESTAdapter.getRepository(repositoryItemIDXO.getRepositoryId()); Asset asset = getAsset(id, repository, new DetachedEntityId(repositoryItemIDXO.getId())); return fromAsset(asset, repository); } @Inject  AssetsResource(final BrowseService browseService,
                        final RepositoryManagerRESTAdapter repositoryManagerRESTAdapter,
                        final AssetEntityAdapter assetEntityAdapter,
                        final MaintenanceService maintenanceService,
                        @Named("asset") final ContinuationTokenHelper continuationTokenHelper); @GET Page<AssetXO> getAssets(@QueryParam("continuationToken") final String continuationToken,
      @QueryParam("repository") final String repositoryId); @GET @Path("/{id}") AssetXO getAssetById(@PathParam("id") final String id); @DELETE @Path("/{id}") void deleteAsset(@PathParam("id")
                          final String id); }
AssetsResource extends ComponentSupport implements Resource, AssetsResourceDoc { @GET @Path("/{id}") public AssetXO getAssetById(@PathParam("id") final String id) { RepositoryItemIDXO repositoryItemIDXO = fromString(id); Repository repository = repositoryManagerRESTAdapter.getRepository(repositoryItemIDXO.getRepositoryId()); Asset asset = getAsset(id, repository, new DetachedEntityId(repositoryItemIDXO.getId())); return fromAsset(asset, repository); } @Inject  AssetsResource(final BrowseService browseService,
                        final RepositoryManagerRESTAdapter repositoryManagerRESTAdapter,
                        final AssetEntityAdapter assetEntityAdapter,
                        final MaintenanceService maintenanceService,
                        @Named("asset") final ContinuationTokenHelper continuationTokenHelper); @GET Page<AssetXO> getAssets(@QueryParam("continuationToken") final String continuationToken,
      @QueryParam("repository") final String repositoryId); @GET @Path("/{id}") AssetXO getAssetById(@PathParam("id") final String id); @DELETE @Path("/{id}") void deleteAsset(@PathParam("id")
                          final String id); static final String RESOURCE_URI; }