@Override
  @SuccessResponse(statuses = { HttpStatus.S_204_NO_CONTENT })
  @ServiceErrors(INVALID_PERMISSIONS)
  @ParamError(code = INVALID_ID, parameterNames = { "albumEntryId" })
  public UpdateResponse update(CompoundKey key, AlbumEntry entity)
  {
    long photoId = (Long) key.getPart("photoId");
    long albumId = (Long) key.getPart("albumId");

    // make sure photo and album exist
    if (!_photoDb.getData().containsKey(photoId))
      throw new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST,
                                       "Nonexistent photo ID: " + photoId);
    if (!_albumDb.getData().containsKey(albumId))
      throw new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST,
                                       "Nonexistent album ID: " + albumId);

    // disallow changing entity ID
    if (entity.hasAlbumId() || entity.hasPhotoId())
      throw new RestLiServiceException(HttpStatus.S_400_BAD_REQUEST,
                                       "Photo/album ID are not acceptable in request");

    // make sure the ID in the entity is consistent with the key in the database
    entity.setPhotoId(photoId);
    entity.setAlbumId(albumId);
    _db.getData().put(key, entity);
    return new UpdateResponse(HttpStatus.S_204_NO_CONTENT);
  }
@Test(expectedExceptions = RestLiServiceException.class)
  public void testBadUpdateAlbumId()
  {
    // album 100 doesn't exist
    CompoundKey key = new CompoundKey().append("photoId", 1L).append("albumId", 100L);
    AlbumEntry entry = new AlbumEntry().setAddTime(4);
    _entryRes.update(key, entry);
  }