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

refactor: remove unsupported chars from filenames #63

Merged
merged 1 commit into from
Jan 22, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CouchDbTestingService(
fun createDocument(database: String, documentName: String, documentContent: String) {
val response = restTemplate
.exchange(
"/$database/$documentName",
"/$database/${documentName.replaceFirst("_", ":")}",
HttpMethod.PUT,
HttpEntity(documentContent),
ObjectNode::class.java,
Expand All @@ -61,7 +61,12 @@ class CouchDbTestingService(
fun addAttachment(database: String, documentName: String, attachmentName: String, documentContent: String) {
val responseDocument = restTemplate
.headForHeaders(
"/$database/$documentName",
"/$database/${
documentName.replaceFirst(
"_",
":"
)
}",
)

val etag = responseDocument.eTag?.replace("\"", "")
Expand All @@ -71,7 +76,12 @@ class CouchDbTestingService(

val response = restTemplate
.exchange(
"/$database/$documentName/$attachmentName",
"/$database/${
documentName.replaceFirst(
"_",
":"
)
}/$attachmentName",
HttpMethod.PUT,
HttpEntity(documentContent, headers),
ObjectNode::class.java,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ object TestContainers {
@Container
@JvmStatic
val CONTAINER_KEYCLOAK: KeycloakContainer = KeycloakContainer()
// .withEnv("JAVA_TOOL_OPTIONS", "-XX:UseSVE=0") # bug on M4 chips with Sequoia 15.2: https://github.com/corretto/corretto-21/issues/85
.withRealmImportFile("/e2e-keycloak-realm.json")
.withAdminUsername("admin")
.withAdminPassword("docker")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Feature: the export endpoint handles template creation
Scenario: client makes call to GET /export/template/TemplateExport:2 and receives an docx
Given database app is created
Given template docx-test-file-1.docx is stored in template engine
Given document TemplateExport:2 is stored in database app
Given document TemplateExport_2 is stored in database app
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/export/template/TemplateExport:2
Then the client receives status code of 200
Expand All @@ -39,30 +39,30 @@ Feature: the export endpoint handles template creation

Scenario: client makes call to POST /export/render/TemplateExport:1 and receives an template id
Given database app is created
Given document TemplateExport:1 is stored in database app
Given document TemplateExport_1 is stored in database app
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls POST /v1/export/render/TemplateExport:1 with body RenderRequest:1
When the client calls POST /v1/export/render/TemplateExport:1 with body RenderRequest_1
Then the client receives status code of 200
Then the client receives value application/pdf for header Content-Type

Scenario: client makes call to POST /export/render/TemplateExport:2 and receives an template id
Given database app is created
Given document TemplateExport:2 is stored in database app
Given document TemplateExport_2 is stored in database app
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls POST /v1/export/render/TemplateExport:2 with body RenderRequest:1
When the client calls POST /v1/export/render/TemplateExport:2 with body RenderRequest_1
Then the client receives status code of 200
Then the client receives value application/pdf for header Content-Type

Scenario: client makes call to POST /export/render/TemplateExport:2 and receives an docx
Given database app is created
Given document TemplateExport:2 is stored in database app
Given document TemplateExport_2 is stored in database app
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls POST /v1/export/render/TemplateExport:2 with body RenderRequest:2
When the client calls POST /v1/export/render/TemplateExport:2 with body RenderRequest_2
Then the client receives status code of 200
Then the client receives value application/vnd.openxmlformats-officedocument.wordprocessingml.document for header Content-Type

Scenario: client makes call to POST /export/render/TemplateExport:not-existing and receives an 404
Given database app is created
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls POST /v1/export/render/TemplateExport:not-existing with body RenderRequest:2
When the client calls POST /v1/export/render/TemplateExport:not-existing with body RenderRequest_2
Then the client receives status code of 404
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Feature: the report endpoints persist to database
Scenario: client makes call to GET /reporting/report/ReportConfig:1 and receives document
Given database app is created
Given database report-calculation is created
Given document ReportConfig:1 is stored in database app
Given document ReportConfig_1 is stored in database app
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report/ReportConfig:1
Then the client receives an json object
Expand All @@ -37,8 +37,8 @@ Feature: the report endpoints persist to database
Scenario: client makes call to GET /reporting/report and receives two document
Given database app is created
Given database report-calculation is created
Given document ReportConfig:1 is stored in database app
Given document ReportConfig:2 is stored in database app
Given document ReportConfig_1 is stored in database app
Given document ReportConfig_2 is stored in database app
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report
Then the client receives status code of 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Feature: the report calculation data endpoint persist to database
Scenario: client makes call to GET /reporting/report-calculation/ReportCalculation:1/data and receives data
Given database app is created
Given database report-calculation is created
Given document ReportConfig:1 is stored in database app
Given document ReportCalculation:1 is stored in database report-calculation
Given attachment ReportData:1 added to document ReportCalculation:1 in report-calculation
Given document ReportConfig_1 is stored in database app
Given document ReportCalculation_1 is stored in database report-calculation
Given attachment ReportData_1 added to document ReportCalculation_1 in report-calculation
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report-calculation/ReportCalculation:1/data
Then the client receives an json object
Expand All @@ -25,7 +25,7 @@ Feature: the report calculation data endpoint persist to database
Scenario: client makes call to GET /reporting/report-calculation/ReportCalculation:42/data and receives NotFound 2
Given database app is created
Given database report-calculation is created
Given document ReportCalculation:1 is stored in database report-calculation
Given document ReportCalculation_1 is stored in database report-calculation
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report-calculation/ReportCalculation:1/data
Then the client receives an json object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Feature: the report calculation endpoint persist to database
Scenario: client makes call to GET /reporting/report-calculation/report/ReportConfig:1 without token and receives Unauthorized
Given database app is created
Given database report-calculation is created
Given document ReportConfig:1 is stored in database app
Given document ReportConfig_1 is stored in database app
When the client calls GET /v1/reporting/report-calculation/report/ReportConfig:1
Then the client receives an json object
Then the client receives status code of 401

Scenario: client makes call to GET /reporting/report-calculation/report/ReportConfig:1 and receives empty list
Given database app is created
Given database report-calculation is created
Given document ReportConfig:1 is stored in database app
Given document ReportConfig_1 is stored in database app
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report-calculation/report/ReportConfig:1
Then the client receives a json array
Expand All @@ -21,19 +21,19 @@ Feature: the report calculation endpoint persist to database
Scenario: client makes call to GET /reporting/report-calculation/report/ReportConfig:1 and receives one element
Given database app is created
Given database report-calculation is created
Given document ReportConfig:1 is stored in database app
Given document ReportCalculation:1 is stored in database report-calculation
Given document ReportConfig_1 is stored in database app
Given document ReportCalculation_1 is stored in database report-calculation
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report-calculation/report/ReportConfig:1
Then the client receives a json array
Then the client receives status code of 200
Then the client receives array with 1 elements

Scenario: client makes call to GET /reporting/report-calculation/ReportCalculation:1 and receives element
Scenario: client makes call to GET /reporting/report-calculation/ReportCalculation_1 and receives element
Given database app is created
Given database report-calculation is created
Given document ReportConfig:1 is stored in database app
Given document ReportCalculation:1 is stored in database report-calculation
Given document ReportConfig_1 is stored in database app
Given document ReportCalculation_1 is stored in database report-calculation
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report-calculation/ReportCalculation:1
Then the client receives an json object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ Feature: the report calculation endpoint persist to database
Given database app is created
Given database report-calculation is created

Scenario: client makes call to POST /reporting/report-calculation/report/ReportConfig:1 without token and receives Unauthorized
Scenario: client makes call to POST /reporting/report-calculation/report/ReportConfig_1 without token and receives Unauthorized
When the client calls POST /v1/reporting/report-calculation/report/ReportConfig:1 without body
# Then the client receives an json object # --> todo: some mismatchedInputException is thrown, needs analyse
# Then the client receives an json object # --> todo_ some mismatchedInputException is thrown, needs analyse
Then the client receives status code of 401

Scenario: client makes call to POST /reporting/report-calculation/report/ReportConfig:1 and receives NotFound
Scenario: client makes call to POST /reporting/report-calculation/report/ReportConfig_1 and receives NotFound
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls POST /v1/reporting/report-calculation/report/ReportConfig:1 without body
Then the client receives an json object
Then the client receives status code of 404

Scenario: client makes call to POST /reporting/report-calculation/report/ReportConfig:1 and receives CalculationId
Given document ReportConfig:1 is stored in database app
Given document ReportConfig_1 is stored in database app
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls POST /v1/reporting/report-calculation/report/ReportConfig:1 without body
Then the client receives an json object
Expand All @@ -27,8 +27,8 @@ Feature: the report calculation endpoint persist to database
Then the client receives value PENDING for property status

Scenario: Pending ReportCalculation is processed within 10 seconds and returns error without Config:CONFIG_ENTITY
Given document ReportConfig:1 is stored in database app
Given document ReportCalculation:2 is stored in database report-calculation
Given document ReportConfig_1 is stored in database app
Given document ReportCalculation_2 is stored in database report-calculation
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report-calculation/ReportCalculation:2
Then the client receives an json object
Expand All @@ -42,9 +42,9 @@ Feature: the report calculation endpoint persist to database
Then the client receives value FINISHED_ERROR for property status

Scenario: Pending ReportCalculation is processed within 10 seconds
Given document ReportConfig:1 is stored in database app
Given document Config:CONFIG_ENTITY is stored in database app
Given document ReportCalculation:2 is stored in database report-calculation
Given document ReportConfig_1 is stored in database app
Given document Config_CONFIG_ENTITY is stored in database app
Given document ReportCalculation_2 is stored in database report-calculation
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report-calculation/ReportCalculation:2
Then the client receives an json object
Expand All @@ -61,9 +61,9 @@ Feature: the report calculation endpoint persist to database
Then the client receives status code of 200

Scenario: ReportCalculation with arguments is processed within 5 seconds
Given document ReportConfig:3 is stored in database app
Given document Config:CONFIG_ENTITY is stored in database app
Given document ReportCalculation:3 is stored in database report-calculation
Given document ReportConfig_3 is stored in database app
Given document Config_CONFIG_ENTITY is stored in database app
Given document ReportCalculation_3 is stored in database report-calculation
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report-calculation/ReportCalculation:3
Then the client receives an json object
Expand All @@ -80,9 +80,9 @@ Feature: the report calculation endpoint persist to database
Then the client receives status code of 200

Scenario: ReportCalculation for v2 ReportConfig is processed within 5 seconds
Given document ReportConfig:4 is stored in database app
Given document Config:CONFIG_ENTITY is stored in database app
Given document ReportCalculation:4 is stored in database report-calculation
Given document ReportConfig_4 is stored in database app
Given document Config_CONFIG_ENTITY is stored in database app
Given document ReportCalculation_4 is stored in database report-calculation
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report-calculation/ReportCalculation:4
Then the client receives an json object
Expand All @@ -99,9 +99,9 @@ Feature: the report calculation endpoint persist to database
Then the client receives status code of 200

Scenario: ReportCalculation for v1 ReportConfig with named arguments is processed within 5 seconds
Given document ReportConfig:5 is stored in database app
Given document Config:CONFIG_ENTITY is stored in database app
Given document ReportCalculation:5 is stored in database report-calculation
Given document ReportConfig_5 is stored in database app
Given document Config_CONFIG_ENTITY is stored in database app
Given document ReportCalculation_5 is stored in database report-calculation
Given signed in as client dummy-client with secret client-secret in realm dummy-realm
When the client calls GET /v1/reporting/report-calculation/ReportCalculation:5
Then the client receives an json object
Expand Down
Loading