diff --git a/lib/modules/manager/osgi/extract.spec.ts b/lib/modules/manager/osgi/extract.spec.ts
index 7250b59f2dc4572bcacadc3c1f8162510c922cdf..cb07c5dc771043ebf8395237878fa9b2070da2fb 100644
--- a/lib/modules/manager/osgi/extract.spec.ts
+++ b/lib/modules/manager/osgi/extract.spec.ts
@@ -1,107 +1,142 @@
+import { codeBlock } from 'common-tags';
 import { extractPackageFile } from '.';
 
-const noArtifacts = `{
-  "configurations": {
-    "org.apache.sling.jcr.davex.impl.servlets.SlingDavExServlet":{
-      "alias":"/server"
+const noArtifacts = codeBlock`
+  {
+    "configurations": {
+      "org.apache.sling.jcr.davex.impl.servlets.SlingDavExServlet": {
+        "alias": "/server"
+      }
     }
   }
-}`;
-const unsupportedFeatureVersion = `{
-  "feature-resource-version": "2.0",
-  "bundles":[
+`;
+
+const unsupportedFeatureVersion = codeBlock`
+  {
+    "feature-resource-version": "2.0",
+    "bundles": [
       {
-          "id":"commons-codec:commons-codec:1.15",
-          "start-order":"5"
+        "id": "commons-codec:commons-codec:1.15",
+        "start-order": "5"
       }
-  ]
-}`;
-const featureWithBundlesAsObjects = `{
-  "feature-resource-version": "1.0",
-  "bundles":[
+    ]
+  }
+`;
+
+const featureWithBundlesAsObjects = codeBlock`
+  {
+    "feature-resource-version": "1.0",
+    "bundles": [
       {
-          "id":"commons-codec:commons-codec:1.15",
-          "start-order":"5"
+        "id": "commons-codec:commons-codec:1.15",
+        "start-order": "5"
       },
       {
-          "id":"commons-collections:commons-collections:3.2.2",
-          "start-order":"15"
+        "id": "commons-collections:commons-collections:3.2.2",
+        "start-order": "15"
       }
-  ]
-}`;
-const featureWithBundlesAsStrings = `{
-  "bundles": [
-    "org.apache.felix/org.apache.felix.scr/2.1.26",
-    "org.apache.felix/org.apache.felix.log/1.2.4"
-  ]
-}`;
-const featureWithComment = `{
-  // comments are permitted
-  "bundles": [ "org.apache.aries:org.apache.aries.util:1.1.3" ]
-}`;
-const artifactsExtension = `{
-  "content-packages:ARTIFACTS|true": [
+    ]
+  }
+`;
+
+const featureWithBundlesAsStrings = codeBlock`
+  {
+    "bundles": [
+      "org.apache.felix/org.apache.felix.scr/2.1.26",
+      "org.apache.felix/org.apache.felix.log/1.2.4"
+    ]
+  }
+`;
+
+const featureWithComment = codeBlock`
+  {
+    // comments are permitted
+    "bundles": [
+      "org.apache.aries:org.apache.aries.util:1.1.3"
+    ]
+  }
+`;
+
+const artifactsExtension = codeBlock`
+  {
+    "content-packages:ARTIFACTS|true": [
       "com.day.cq:core.wcm.components.all:zip:2.21.0"
-  ]
-}`;
-const doubleSlashNotComment = `{
-  "bundles":[
-       {
-           "id":"com.h2database:h2-mvstore:2.1.214",
-           "start-order":"15"
+    ]
+  }
+`;
+
+const doubleSlashNotComment = codeBlock`
+  {
+    "bundles": [
+      {
+        "id": "com.h2database:h2-mvstore:2.1.214",
+        "start-order": "15"
       },
       {
-           "id":"org.mongodb:mongo-java-driver:3.12.11",
-           "start-order":"15"
-       }
-  ],
-  "configurations":{
-      "org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService":{
-          "db":"sling",
-          "mongouri":"mongodb://$[env:MONGODB_HOST;default=localhost]:$[env:MONGODB_PORT;type=Integer;default=27017]"
-       }
+        "id": "org.mongodb:mongo-java-driver:3.12.11",
+        "start-order": "15"
+      }
+    ],
+    "configurations": {
+      "org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService": {
+        "db": "sling",
+        "mongouri": "mongodb://$[env:MONGODB_HOST;default=localhost]:$[env:MONGODB_PORT;type=Integer;default=27017]"
+      }
+    }
   }
-}`;
-const frameworkArtifact = `{
-  "execution-environment:JSON|false":{
-      "framework":{
-          "id":"org.apache.felix:org.apache.felix.framework:7.0.5"
+`;
+
+const frameworkArtifact = codeBlock`
+  {
+    "execution-environment:JSON|false": {
+      "framework": {
+        "id": "org.apache.felix:org.apache.felix.framework:7.0.5"
       }
+    }
   }
-}`;
-const versionWithVariable = `{
-  "bundles":[
+`;
+
+const versionWithVariable = codeBlock`
+  {
+    "bundles": [
       {
-          "id":"com.fasterxml.jackson.core:jackson-annotations:$\{jackson.version}",
-          "start-order":"20"
+        "id": "com.fasterxml.jackson.core:jackson-annotations:\${jackson.version}",
+        "start-order": "20"
       }
-  ]
-}`;
-const malformedDefinitions = `{
-  "bundles":[
+    ]
+  }
+`;
+
+const malformedDefinitions = codeBlock`
+  {
+    "bundles": [
       {
-          "#": "missing the 'id' attribute",
-          "not-id":"commons-codec:commons-codec:1.15"
+        "#": "missing the 'id' attribute",
+        "not-id": "commons-codec:commons-codec:1.15"
       },
       {
-          "#": "too few parts in the GAV definition",
-          "id":"commons-codec:1.15"
+        "#": "too few parts in the GAV definition",
+        "id": "commons-codec:1.15"
       },
       {
-          "#": "valid definition, should be extracted",
-          "id":"commons-codec:commons-codec:1.15"
+        "#": "valid definition, should be extracted",
+        "id": "commons-codec:commons-codec:1.15"
       }
-  ]
-}`;
-const invalidFeatureVersion = `{
-  "feature-resource-version": "unknown",
-  "bundles":[
+    ]
+  }
+`;
+
+const invalidFeatureVersion = codeBlock`
+  {
+    "feature-resource-version": "unknown",
+    "bundles": [
       {
-          "id":"commons-codec:commons-codec:1.15",
-          "start-order":"5"
+        "id": "commons-codec:commons-codec:1.15",
+        "start-order": "5"
       }
-  ]
-}`;
+    ]
+  }
+`;
 
 describe('modules/manager/osgi/extract', () => {
   describe('extractPackageFile()', () => {