sul-dlss / dor-services-app

A Rails application exposing Digital Object Registry functions as a RESTful HTTP API
https://sul-dlss.github.io/dor-services-app/
Other
3 stars 2 forks source link

Test moving versions #5159

Closed justinlittman closed 1 month ago

justinlittman commented 1 month ago
  1. Ran h2_versioned_object_creation_spec, which produced https://argo-stage.stanford.edu/view/zv072xy0663.
image
  1. Downloaded the descriptive metadata for version 2 / user version 1 and appended "- change 1" to the title.
  2. Opened version 4, uploaded the modified descriptive metadata, and closed the version.
image
  1. Downloaded the descriptive metadata for version 3 and appended "- change 2" to the title.
  2. Opened version 5, uploaded the modified descriptive metadata, and closed the version.
image
  1. Moved user version 1 to object version 4.
3.3.0 :001 > ro = RepositoryObject.find_by(external_identifier: 'druid:zv072xy0663')
 =>
#<RepositoryObject:0x00007f9031b29260
...
3.3.0 :002 > uv1 = ro.user_versions.find_by(version: 1)
 =>
#<UserVersion:0x00007f90337de540
...
3.3.0 :003 > ov4 = ro.versions.find_by(version: 4)
 =>
#<RepositoryObjectVersion:0x00007f9033732ba0
...
3.3.0 :004 > uv1.repository_object_version = ov4
 =>
#<RepositoryObjectVersion:0x00007f9033732ba0
...
3.3.0 :005 > uv1.save!
 => true
image
  1. Re-published user version 1.
3.3.0 :006 > Publish::MetadataTransferService.publish(druid: 'druid:zv072xy0663', user_version: 1)
D, [2024-08-07T12:29:10.590210 #2846529] DEBUG -- : Starting a publish request for: druid:zv072xy0663
D, [2024-08-07T12:29:10.702054 #2846529] DEBUG -- : Publish request complete
D, [2024-08-07T12:29:10.733707 #2846529] DEBUG -- : Starting an release request for: druid:zv072xy0663
D, [2024-08-07T12:29:10.859854 #2846529] DEBUG -- : Release request complete
 => true

PURL result:

image image