Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(add-test-file): add response file for test case (DSP-1841) (#1894)
* add response file for test case

* fix typo in test data
  • Loading branch information
irinaschubert committed Aug 4, 2021
1 parent e0e9073 commit 028e685
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions webapi/scripts/expected-client-test-data.txt
Expand Up @@ -237,6 +237,7 @@ test-data/v2/resources/testding.json
test-data/v2/resources/thing-with-picture.json
test-data/v2/resources/update-resource-metadata-request-with-last-mod-date.json
test-data/v2/resources/update-resource-metadata-request.json
test-data/v2/resources/update-resource-metadata-response-with-last-mod-date.json
test-data/v2/resources/update-resource-metadata-response.json
test-data/v2/search/
test-data/v2/search/thing-links.json
Expand Down
Expand Up @@ -218,7 +218,7 @@ class PermissionsADME2ESpec extends E2ESpec(PermissionsADME2ESpec.config) with T
val customAPIri = "http://rdfh.ch/permissions/0001/u0PRnDl3kgcbrehZnRlEfA"
val createAdministrativePermissionWithCustomIriRequest: String =
s"""{
| "id": "$customAPIri,
| "id": "$customAPIri",
| "forGroup":"${SharedTestDataADM.thingSearcherGroup.id}",
| "forProject":"${SharedTestDataADM.ANYTHING_PROJECT_IRI}",
| "hasPermissions":[{"additionalInformation":null,"name":"ProjectAdminGroupAllPermission","permissionCode":null}]
Expand Down
Expand Up @@ -1626,6 +1626,17 @@ class ResourcesRouteV2E2ESpec extends E2ESpec(ResourcesRouteV2E2ESpec.config) {
newLastModificationDate = newModificationDate,
maybeNewPermissions = newPermissions)))

clientTestDataCollector.addFile(
TestDataFileContent(
filePath = TestDataFilePath(
directoryPath = clientTestDataPath,
filename = "update-resource-metadata-response-with-last-mod-date",
fileExtension = "json"
),
text = updateResponseAsString
)
)

val previewRequest = Get(s"$baseApiUrl/v2/resourcespreview/${URLEncoder.encode(resourceIri, "UTF-8")}") ~> addCredentials(
BasicHttpCredentials(anythingUserEmail, password))
val previewResponse: HttpResponse = singleAwaitingRequest(previewRequest)
Expand Down

0 comments on commit 028e685

Please sign in to comment.