Skip to content

Instantly share code, notes, and snippets.

@nblair
Last active December 20, 2019 16:30
Show Gist options
  • Save nblair/85b34948de59e5a5f458fb81fb014d00 to your computer and use it in GitHub Desktop.
Save nblair/85b34948de59e5a5f458fb81fb014d00 to your computer and use it in GitHub Desktop.
3.19 vs 3.20 BlobStoreConfiguration use within Groovy API
diff --git a/system-under-test/post-install-scenarios/01_blobstore.groovy b/system-under-test/post-install-scenarios/01_blobstore.groovy
index ea8db9d..9dbf852 100644
--- a/system-under-test/post-install-scenarios/01_blobstore.groovy
+++ b/system-under-test/post-install-scenarios/01_blobstore.groovy
@@ -1,14 +1,15 @@
-import org.sonatype.nexus.blobstore.api.BlobStoreConfiguration
import org.sonatype.nexus.blobstore.api.BlobStoreManager
import groovy.json.JsonSlurper
def object = new JsonSlurper().parseText(args)
def blobStoreManager = container.lookup(BlobStoreManager.class.name)
-blobStoreManager.create(new BlobStoreConfiguration(name: 'default', type: 'Google Cloud Storage',
- attributes: [
- 'google cloud storage': [
- bucket: "${object.name}".toString(),
- ]
- ]))
-
+def config = blobStoreManager.newConfiguration()
+config.name = 'default'
+config.type = 'Google Cloud Storage'
+config.setAttributes(
+ 'google cloud storage': [
+ bucket: "${object.name}".toString(),
+ ]
+)
+blobStoreManager.create(config)
@nblair
Copy link
Author

nblair commented Dec 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment