@Test public void testGetAssetById_illegalArgumentException() { RepositoryItemIDXO repositoryItemIDXO = new RepositoryItemIDXO("maven-releases", "c0ac2ab6c5e93a4a3909f0830fdadfcd"); doThrow(new IllegalArgumentException()).when(assetEntityAdapter) .recordIdentity(new DetachedEntityId(repositoryItemIDXO.getId())); thrown.expect(hasProperty("response", hasProperty("status", is(UNPROCESSABLE_ENTITY)))); 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; }