@Test public void getAssetByIdShouldReturnAnAssetWhenFound() { when(fluentAssets.find(new DetachedEntityId(AN_ASSET_ID + ""))) .thenReturn(Optional.of(aFluentAsset())); AssetXO assetXO = underTest.getAssetById(anEncodedAssetId()); assertThat(assetXO, is(anAssetXO())); }
@GET @Path("/{id}") @Override 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 AssetsResourceSupport implements Resource, AssetsResourceDoc { @GET @Path("/{id}") @Override 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 AssetsResourceSupport implements Resource, AssetsResourceDoc { @GET @Path("/{id}") @Override 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 RepositoryManagerRESTAdapter repositoryManagerRESTAdapter,
      final MaintenanceService maintenanceService,
      final ContentAuthHelper contentAuthHelper); }
AssetsResource extends AssetsResourceSupport implements Resource, AssetsResourceDoc { @GET @Path("/{id}") @Override 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 RepositoryManagerRESTAdapter repositoryManagerRESTAdapter,
      final MaintenanceService maintenanceService,
      final ContentAuthHelper contentAuthHelper); @GET @Override Page<AssetXO> getAssets(
      @Nullable @QueryParam("continuationToken") final String continuationToken,
      @QueryParam("repository") final String repositoryId); @GET @Path("/{id}") @Override AssetXO getAssetById(@PathParam("id") final String id); @DELETE @Path("/{id}") @Override void deleteAsset(@PathParam("id") final String id); }
AssetsResource extends AssetsResourceSupport implements Resource, AssetsResourceDoc { @GET @Path("/{id}") @Override 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 RepositoryManagerRESTAdapter repositoryManagerRESTAdapter,
      final MaintenanceService maintenanceService,
      final ContentAuthHelper contentAuthHelper); @GET @Override Page<AssetXO> getAssets(
      @Nullable @QueryParam("continuationToken") final String continuationToken,
      @QueryParam("repository") final String repositoryId); @GET @Path("/{id}") @Override AssetXO getAssetById(@PathParam("id") final String id); @DELETE @Path("/{id}") @Override void deleteAsset(@PathParam("id") final String id);  }