Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(add-test-file): add response file for test case (DSP-1841) #1894

Merged
merged 2 commits into from Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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