-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract json strings to individual resource files (!1193)
- Loading branch information
1 parent
5775401
commit b8f2476
Showing
72 changed files
with
2,447 additions
and
2,477 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
common/testing/src/testFixtures/kotlin/org/orkg/common/testing/fixtures/Assets.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.orkg.common.testing.fixtures | ||
|
||
import java.net.URI | ||
import org.springframework.core.io.ClassPathResource | ||
|
||
object Assets { | ||
fun requestJson(name: String): String = fileContents("requests/$name.json").decodeToString() | ||
|
||
fun responseJson(name: String): String = fileContents("responses/$name.json").decodeToString() | ||
|
||
private fun fileContents(name: String): ByteArray = | ||
ClassPathResource(URI.create("classpath:/assets/$name").path).inputStream.use { it.readBytes() } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
...pes-adapter-output-simcomp/src/test/resources/assets/responses/simcomp/thingResponse.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"timestamp": "2024-01-26T09:26:34.297967", | ||
"uuid": "b8e897af-e9c9-46e0-884b-90e2407b2341", | ||
"payload": { | ||
"thing": { | ||
"id": "116eddfd-d6f3-4a31-a96b-24574b3d62cc", | ||
"created_at": "2022-02-22T06:02:14.292384Z", | ||
"updated_at": "2022-02-22T06:02:14.292395Z", | ||
"thing_type": "LIST", | ||
"thing_key": "R166718", | ||
"config": {}, | ||
"data": { | ||
"rootResource": "R465", | ||
"statements": [ | ||
{ | ||
"id": "S663825", | ||
"subject": { | ||
"id": "R166714", | ||
"label": "Entry", | ||
"created_at": "2022-02-22T08:01:13.261082+01:00", | ||
"classes": [], | ||
"shared": 1, | ||
"created_by": "d5416c16-1a45-4aee-8069-be1b6097478b", | ||
"_class": "resource", | ||
"observatory_id": "00000000-0000-0000-0000-000000000000", | ||
"extraction_method": "UNKNOWN", | ||
"organization_id": "00000000-0000-0000-0000-000000000000", | ||
"featured": false, | ||
"unlisted": false | ||
}, | ||
"predicate": { | ||
"id": "HasPaper", | ||
"label": "has paper", | ||
"created_at": "2021-04-26T16:57:34.745465+02:00", | ||
"created_by": "00000000-0000-0000-0000-000000000000", | ||
"_class": "predicate", | ||
"description": null | ||
}, | ||
"object": { | ||
"id": "C12457", | ||
"label": "Some class", | ||
"uri": "https://orkg.org/class/C12457", | ||
"description": "class description", | ||
"created_at": "2022-02-22T08:01:13.261082+01:00", | ||
"created_by": "d5416c16-1a45-4aee-8069-be1b6097478b", | ||
"_class": "class" | ||
}, | ||
"created_at": "2022-02-22T08:01:15.253502+01:00", | ||
"created_by": "d5416c16-1a45-4aee-8069-be1b6097478b" | ||
}, | ||
{ | ||
"id": "S5436", | ||
"subject": { | ||
"id": "R56984", | ||
"label": "Other resource", | ||
"created_at": "2022-02-22T08:01:12.709843+01:00", | ||
"classes": [ | ||
"Entry" | ||
], | ||
"shared": 1, | ||
"created_by": "d5416c16-1a45-4aee-8069-be1b6097478b", | ||
"_class": "resource", | ||
"observatory_id": "00000000-0000-0000-0000-000000000000", | ||
"extraction_method": "MANUAL", | ||
"organization_id": "00000000-0000-0000-0000-000000000000", | ||
"visibility": "FEATURED" | ||
}, | ||
"predicate": { | ||
"id": "HasPaper", | ||
"label": "has paper", | ||
"created_at": "2021-04-26T16:57:34.745465+02:00", | ||
"created_by": "00000000-0000-0000-0000-000000000000", | ||
"_class": "predicate", | ||
"description": null | ||
}, | ||
"object": { | ||
"id": "L354354", | ||
"label": "Some literal", | ||
"created_at": "2022-02-22T08:01:12.709843+01:00", | ||
"created_by": "d5416c16-1a45-4aee-8069-be1b6097478b", | ||
"_class": "literal", | ||
"datatype": "xsd:string" | ||
}, | ||
"created_at": "2023-02-22T08:01:15.253502+01:00", | ||
"created_by": "d5416c16-1a45-4aee-8069-be1b6097478b" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...ent-types-adapter-output-web/src/test/resources/assets/requests/datacite/registerDoi.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"data": { | ||
"attributes": { | ||
"doi": "10.7484/182", | ||
"event": "draft", | ||
"creators": [ | ||
{ | ||
"name": "Josiah Stinkney Carberry", | ||
"nameIdentifiers": [ | ||
{ | ||
"schemeUri": "https://orcid.org", | ||
"nameIdentifier": "https://orcid.org/0000-0002-1825-0097", | ||
"nameIdentifierScheme": "ORCID" | ||
} | ||
], | ||
"nameType":"Personal" | ||
}, | ||
{ | ||
"name": "Author 2", | ||
"nameIdentifiers": [], | ||
"nameType": "Personal" | ||
} | ||
], | ||
"titles": [ | ||
{ | ||
"title": "Paper title", | ||
"lang": "en" | ||
} | ||
], | ||
"publicationYear": 2023, | ||
"subjects": [ | ||
{ | ||
"subject": "Paper subject", | ||
"lang": "en" | ||
} | ||
], | ||
"types": { | ||
"resourceType": "Paper", | ||
"resourceTypeGeneral": "Dataset" | ||
}, | ||
"relatedIdentifiers": [ | ||
{ | ||
"relatedIdentifier": "https://doi.org/10.48366/r609337", | ||
"relatedIdentifierType": "DOI", | ||
"relationType": "IsVariantFormOf" | ||
} | ||
], | ||
"rightsList": [ | ||
{ | ||
"rights": "Creative Commons Attribution-ShareAlike 4.0 International License.", | ||
"rightsUri": "https://creativecommons.org/licenses/by-sa/4.0/" | ||
} | ||
], | ||
"descriptions": [ | ||
{ | ||
"description": "Description of the paper", | ||
"descriptionType": "Abstract" | ||
} | ||
], | ||
"url": "https://example.org", | ||
"language": "en", | ||
"publisher": "Open Research Knowledge Graph" | ||
}, | ||
"type": "dois" | ||
} | ||
} |
Oops, something went wrong.